首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >mod_rewrite:由于可能的配置错误,请求超过了10个内部重定向的限制

mod_rewrite:由于可能的配置错误,请求超过了10个内部重定向的限制
EN

Stack Overflow用户
提问于 2018-06-02 11:52:23
回答 1查看 200关注 0票数 0

我在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错误,而不是“内部服务器错误”。

如何修复它?

谢谢。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50653343

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档