500内部服务器错误而不是404

时间:2013-06-19 01:47:29

标签: .htaccess http-status-code-404

这是我的.htaccess

ErrorDocument 404 /404.html

但是当我输入一个错误的网址,例如http://127.0.0.1:8080/myweb/wrong-url.php时,这不会转到404.html并说500内部服务器错误 任何人都可以解释原因吗?

错误日志中显示的错误是

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.

1 个答案:

答案 0 :(得分:2)

您的404.html页面本身可能会生成另一个404,因为该位置不是/404.html,而是/myweb/404.html。基本上它试图找到404.html文件,但不能,它生成另一个404,然后尝试查找404.html文件,但不能,这会生成另一个404等等。更改您的{ {1}}将404指向.htaccess,或将文件移至服务器的根目录。

相关问题