【发布时间】:2015-11-17 08:07:38
【问题描述】:
这是我的 .htaccess
ErrorDocument 404 /404.html
但是当我输入错误的 url 时,例如 http://127.0.0.1:8080/myweb/wrong-url.php,不会转到 404.html 并显示 500 INTERNAL SERVER ERROR
任何机构都可以解释为什么?
我的错误日志中显示的错误是
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.
【问题讨论】:
-
您尝试运行的脚本失败。这就是任何人都可以从那个错误中告诉你的所有内容。您需要检查日志以确定失败的确切原因。
-
但是我没有任何用于 wrong-url.php 的脚本,这只是输入错误 url 的一个例子,假设我有两个页面,家庭和联系人,我有输入错误的网址,它应该转到 404 而不是 500
-
.htaccess 是在根目录中,还是在 myweb/ 中?你有它在根目录,而不是在 myweb/?
-
@jprofitt 它在 myweb 目录中而不是在根目录中,因为在我的本地主机中我有多个网站,所以该网站的 .htacess 位于其各自的文件夹中
-
您可以访问错误日志吗?它可能会让您深入了解根本原因是什么。
标签: .htaccess http-status-code-404