[英]Getting 404 Not Found error while trying to use ErrorDocument
I know this thread has been talked a lot on the web and here, and I tried almost all the methods, but still I'm having the same problem. 我知道这个帖子已经在网上和这里谈了很多,我尝试了几乎所有的方法,但我仍然遇到同样的问题。
This is my url on my local server ( MAMP ) 这是我本地服务器(MAMP)上的网址
http://localhost:8888/hellothere/index.php
And I've tried to insert a wrong path to take me to wrong page , like below : 而且我试图插入错误的路径将我带到错误的页面,如下所示:
http://localhost:8888/hellothere/eiurgiuerib
Instead of taking me to Error Page it shows : 而不是带我到错误页面它显示:
Not Found
The requested URL /hellothere/eiurgiuerib was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
My 404 page is inside of the Error directory. 我的404页面位于Error目录中。 And inside my .htaccess file I have included this : 在我的.htaccess文件中,我包含了这个:
ErrorDocument 404 /Error/404.php
The ErrorDocument
directive, when supplied a local URL path, expects the path to be fully qualified from the DocumentRoot
. ErrorDocument
指令在提供本地URL路径时,期望从DocumentRoot
完全限定路径。 In your case, this means that the actual path to the ErrorDocument
is 在您的情况下,这意味着ErrorDocument
的实际路径是
ErrorDocument 404 /hellothere/error/404page.html
When we apply local url, ErrorDocument directive expect the full path from DocumentRoot. 当我们应用本地URL时,ErrorDocument指令期望DocumentRoot的完整路径。 There fore, 因此,
ErrorDocument 404 /yourfoldernames/errors/404.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.