Blocking Bad Bots Causes Redirect Loop on Apache
-
After enabling HackRepair.com blacklist and adding the bot “MJ12bot”, I started seeing the following error several times a day:
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
By comparing the error log with the access log, I was able to determine it was the blocked bot causing these errors.
After spending much time, I finally came across a thread where it was explained that the following line (right before # End HackRepair.com Blacklist):
RewriteRule ^.* - [F,L]
Redirects everything to forbidden, even the 403.html error page it’s redirected to! This results in an infinite loop.
To resolve this, I replaced that line with this:
RewriteRule !^error - [F,L]
Telling it to redirect everything except my error directory.
This was a headache for me. Hopefully this helps someone else!
- The topic ‘Blocking Bad Bots Causes Redirect Loop on Apache’ is closed to new replies.