GrepBoard/Manuals
605 manuals ·

Fix Apache AH00124: exceeded the limit of 10 internal redirects

·Tested on Apache httpd 2.4.69 (Docker) · 2026-10·Test scope ↓·5 steps

AH00124 "exceeded the limit of 10 internal redirects" means a rewrite loop, such as an .htaccess RewriteRule matching its own output. Add a RewriteCond.

The page opens as a 500 and error_log holds this line. The timestamp and pid are shortened to ….

output
… [core:error] … [client 203.0.113.5:39490] 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.

AH00124: Request exceeded the limit of 10 internal redirects means one request was processed internally more than ten times and httpd cut it off as an endless loop. The server is not slow and the limit is not too low: the configuration is chasing its own tail. So do not raise the limit; add a condition to the rewrite rule that creates the loop (a RewriteRule in .htaccess, for example) so it stops matching its own output. The steps below find that rule. The access log shows GET /app/x HTTP/1.1" 500.

[1] Raise the log level to see the URL that repeats. As the message says, set LogLevel debug, reload the configuration and request the same address once. Debug is very noisy, so put it back to warn as soon as you have the lines. On a production server, raising only one module with LogLevel warn core:debug avoids the flood (per-module LogLevel is in the official docs; the backtrace lines below are core:debug, so they should appear, but this combination was not tested and the test used plain debug).

/etc/apache2/apache2.conf
LogLevel debug

[2] The AH00121 and AH00122 lines right after the error are the backtrace. They list how the original /app/x was rewritten, newest first.

output
… [core:debug] … AH00121: r->uri = /app/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/x… [core:debug] … AH00122: redirected from r->uri = /app/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/x… [core:debug] … AH00122: redirected from r->uri = /app/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/x…… [core:debug] … AH00122: redirected from r->uri = /app/index.php/x… [core:debug] … AH00122: redirected from r->uri = /app/x

Each round prepends one more /index.php. A rule is matching the URL it produced itself. This test reproduced only this growing-URL pattern.

[3] Find the rule that starts the loop. In this test it was an unconditional rule in that directory's .htaccess.

run/htaccess-bad.conf
RewriteEngine OnRewriteRule ^(.*)$ /app/index.php/$1

^(.*)$ matches every path, and the result /app/index.php/x is in the same directory, so it matches the rule again. Skip existing files and directories with conditions, and pin the target.

run/htaccess-fixed.conf
RewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /app/index.php [L]

Caution: the original rule passed the path on as /app/index.php/$1 (PATH_INFO); the fixed rule does not. If your app routes by PATH_INFO, every address may land on the front page. The test served index.php as a static file without PHP and only checked the "front controller" string, so whether routing survives was not verified. Check which value your app reads first, and test a variant that keeps $1 in a staging environment.

[4] Check the result. Unknown paths go to index.php, real files open as they are, and no new AH00124 line appeared.

output
front controller <- /app/x HTTP 200static file <- /app/real.txt HTTP 200front controller <- /app/a/b/c HTTP 200

[5] Raising the limit is not a fix. With the same bad rule, LimitInternalRecursion 100 only changes the number in the message.

output
… [core:error] … AH00124: Request exceeded the limit of 100 internal redirects due to probable configuration error. …

The official documentation lists the directive for server config and virtual host context only, and describes it as a guard against infinite loops. Raise it only if you have a legitimate, long chain.

For a 403 instead, see AH01630.

Analyze your Apache log in the browser ↗ — nothing is uploaded.

#apache#httpd#mod_rewrite#htaccess#ah00124