Today I checked my Apache error.log and I found many:
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.
...mostly from Bing bot.
So i traced the error to my access log and I found that these errors are being caused by some site/bots requesting a file that no longer exists. Which should create 404 (not found) error, but instead it is redirecting the site to look somewhere else and then that place is telling it to look in the first place, causing an internal redirect which only stops once it reaches the maximum of 10 internal redirects. At this point it puts out a 500 internal error and it's crawled over again and again.
Subdomains are in:
/home/html/myname/public_html/_sub/thisisasubdomain/
Resulting domain is:
thisisasubdomain.myname.com
When I try to access a non existing directory in the _sub directory, then I get the 500 error/Request exceeded error.
My VPS has pre-installed server with this rewrite.conf, defined in :
RewriteEngine On
RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} !^/webmail(/|$)?
RewriteCond %{REQUEST_URI} !^/horde(/|$)?
RewriteCond %{REQUEST_URI} !^/roundcube(/|$)?
RewriteCond %{REQUEST_URI} !^/setup(2|-new)?(/|$)?
RewriteCond %{REQUEST_URI} !^/webftp(1|2)?(/|$)?
RewriteCond %{REQUEST_URI} !^/(db|pg)admin(/|$)?
RewriteCond ${lowercase:%{SERVER_NAME}} ^([0-9a-z-]+)\.([0-9a-z]+)$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ([0-9a-z-]+)\.([0-9a-z]+)/(.*) /home/html/$1\.$2/public_html/$3
RewriteCond %{REQUEST_URI} !^/webmail(/|$)?
RewriteCond %{REQUEST_URI} !^/horde(/|$)?
RewriteCond %{REQUEST_URI} !^/roundcube(/|$)?
RewriteCond %{REQUEST_URI} !^/setup(2|-new)?(/|$)?
RewriteCond %{REQUEST_URI} !^/webftp(1|2)?(/|$)?
RewriteCond %{REQUEST_URI} !^/(db|pg)admin(/|$)?
RewriteCond ${lowercase:%{SERVER_NAME}} ^www\.([0-9a-z-]+)\.([0-9a-z]+)$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule www\.([0-9a-z-]+)\.([0-9a-z]+)/(.*) /home/html/$1\.$2/public_html/$3
RewriteCond %{REQUEST_URI} !^/webmail(/|$)?
RewriteCond %{REQUEST_URI} !^/horde(/|$)?
RewriteCond %{REQUEST_URI} !^/roundcube(/|$)?
RewriteCond %{REQUEST_URI} !^/setup(2|-new)?(/|$)?
RewriteCond %{REQUEST_URI} !^/webftp(1|2)?(/|$)?
RewriteCond %{REQUEST_URI} !^/(db|pg)admin(/|$)?
RewriteCond ${lowercase:%{SERVER_NAME}} !^www\.([0-9a-z-]+)\.([0-9a-z]+)$
RewriteCond ${lowercase:%{SERVER_NAME}} ^([0-9a-z-]+)\.([0-9a-z-]+)\.([0-9a-z]+)$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ([0-9a-z-]+)\.([0-9a-z-]+)\.([0-9a-z]+)/(.*) /home/html/$2\.$3/public_html/_sub/$1/$4
RewriteCond %{REQUEST_URI} !^/webmail(/|$)?
RewriteCond %{REQUEST_URI} !^/horde(/|$)?
RewriteCond %{REQUEST_URI} !^/roundcube(/|$)?
RewriteCond %{REQUEST_URI} !^/setup(2|-new)?(/|$)?
RewriteCond %{REQUEST_URI} !^/webftp(1|2)?(/|$)?
RewriteCond %{REQUEST_URI} !^/(db|pg)admin(/|$)?
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)\.([0-9a-z-]+)\.([0-9a-z-]+)\.([0-9a-z]+)$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule (.+)\.([0-9a-z-]+)\.([0-9a-z-]+)\.([0-9a-z]+)/(.*) /home/html/$3\.$4/public_html/_sub/$2/$5
Any help is appreciated.
.htaccess
" - Those directives can't be from your.htaccess
file?! TheRewriteMap
directive is not permitted in a directory (or.htaccess
) context - this alone would result in a 500 error (if processed). But also you can't rewrite to a filesystem path in.htaccess
(which is what all theseRewriteRule
directives are doing). These directives would only work at all in a server config (or virtual host) context? What should be served in the case of a 404? How should this be served? Do you have a custom 404ErrorDocument
defined somewhere? – MrWhite Nov 30 '17 at 16:59[L]
on some of your rewrite rules (the ones with/home/html
). It doesn't look like you expect multiple of those rules to match. – Stephen Ostermiller♦ Nov 30 '17 at 17:31RewriteRule ^/webmail(/|$)? - [L]
– Stephen Ostermiller♦ Nov 30 '17 at 17:33RewriteCond %{REQUEST_FILENAME} !-f
andRewriteCond %{REQUEST_FILENAME} !-d
which would be a lot simpler. – Stephen Ostermiller♦ Nov 30 '17 at 17:35