简体   繁体   English

尝试使用ErrorDocument时出现404 Not Found错误

[英]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.

相关问题 在 codeigniter 中出错:尝试使用 ErrorDocument 处理请求时遇到 404 Not Found 错误 - Getting error in codeigniter : a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request 尝试使用 ErrorDocument 处理请求时遇到 404 Not Found 错误 - A 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request htaccess:尝试 ErrorDocument 时出现 404 Not Found 错误 - htaccess: 404 Not Found Error While trying ErrorDocument drupal内部服务器错误。 此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。 - drupal internal server error. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request Codeigniter ,尝试使用 ErrorDocument 处理请求时遇到 404 Not Found 错误 - Codeigniter , 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request 尝试使用ErrorDocument处理请求时遇到500内部服务器错误错误 - a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request 尝试使用ErrorDocument处理请求时遇到500 Internal Server Error错误 - 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request 尝试使用 ErrorDocument 处理 symfony 5 中的请求时遇到 500 Internal Server Error 错误 - 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request in symfony 5 此外,尝试使用ErrorDocument处理请求时遇到403 Forbidden错误 - Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request Laravel 8:尝试删除用户时出现 404“未找到”页面 - Laravel 8: Getting 404 “Not Found” Page While Trying To Delete User
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM