ErrorDocument + HTTP error can cause: Request exceeded the limit of 10 internal redirects
short description
Error: 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.
When using error document and redirect/deny with fail 4xx / 5xx
example
The error document is activated for the vhost In .htaccess:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^([0-9]{1,3})\.
RewriteCond %{DOCUMENT_ROOT}/block/%1/%{REMOTE_ADDR}.txt -f
RewriteRule . - [F,L]
correct behaviour
Should return the error document
environment
Server OS: any
Server OS version: any
ISPConfig version: all version (3.1.13)
proposed fix
When the error document is activated, it should exists a rewrite rule that lead to error document prior any processing.
Alias /error/ "/var/www/domain.tld/web/error/"
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/error/ - [L]
</IfModule>
==> server/conf/vhost.conf.master (line 55)
<tmpl_if name='errordocs'>
Alias /error/ "<tmpl_var name='web_document_root_www'>/error/"
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/error/ - [L]
</IfModule>
</tmpl_if>