我在linux上运行Apache2.4和PHP5.6,当用户访问本网站中不存在的文件或目录(例如://1.asp或/aa/ )时,我注意到以下错误测试
浏览器显示:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@xxx.edu to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache错误日志:
[core:error] [pid 12843] [client 202.xxx.xxx.xxx:64587] 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.
.htaccess文件:
Options -MultiViews
Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(en|zh|ja|ko)/(.*)$ $2?lang=$1 [L,QSA]
RewriteRule ^(.*)$ $1?lang=zh [L,QSA]
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
重写规则执行:
http://www.example.com/en => http://www.example.com/index.php?lang=en
http://www.example.com/jo => http://www.example.com/index.php?lang=jo
http://www.example.com/zh => http://www.example.com/index.php?lang=zh
默认值:
http://www.example.com => http://www.example.com/index.php?lang=zh
当用户访问本网站中不存在文件或目录时,应返回404错误,而不是“内部服务器错误”。
如何修复它?
谢谢。
https://stackoverflow.com/questions/50653343
复制相似问题