LimitInternalRecursion ? 500 Internal Server Error

2021052511:09
500 Internal Server Error

apache httpd error log 訊息是:

[Mon May 24 01:12:23.603697 2021] [core:error] [pid 7464] [client 125.227.39.235:50495] 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.

不一定是 LimitInternalRecursion 的問題
有可能是 .htaccess 寫錯
例如
.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /asdasd/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /asdasd/index.php [L]
</IfModule>
  多了 asdasd 這個 folder,移除後就會正常


**
core - Apache HTTP Server Version 2.4

An internal redirect happens, for example, when using the Action directive, which internally redirects the original request to a CGI script. A subrequest is Apache httpd's mechanism to find out what would happen for some URI if it were requested. For example, mod_dir uses subrequests to look for the files listed in the DirectoryIndex directive.

LimitInternalRecursion prevents the server from crashing when entering an infinite loop of internal redirects or subrequests. Such loops are usually caused by misconfigurations.

The directive stores two different limits, which are evaluated on per-request basis. The first number is the maximum number of internal redirects that may follow each other. The second number determines how deeply subrequests may be nested. If you specify only one number, it will be assigned to both limits.