Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 )

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. And inside my .htaccess file I have included this :

ErrorDocument 404 /Error/404.php 
like image 697
user1725155 Avatar asked Oct 06 '12 13:10

user1725155


People also ask

How do you fix HTTP Error 404.0 not found The resource you are looking for has been removed had its name changed or is temporarily unavailable?

To resolve this problem, use one of the following methods: Make sure that the requested resource is at the location that the URL points to. Review the URL that you open in the Web browser. Make sure that no custom filters or modules restrict access to the file that you want to browse.

Why am I getting 404 file or directory not found?

The Web server returns the HTTP 404 - File not found error message when it cannot retrieve the page that was requested. The following are some common causes of this error message: The requested file has been renamed. The requested file has been moved to another location and/or deleted.

What does Error 404 or not found error while accessing a URL means?

A 404 error message is a Hypertext Transfer Protocol (HTTP) status code indicating the server could not find the requested website. In other words, your web browser can connect with the server, but the specific page you're trying to access can't be reached.


2 Answers

The ErrorDocument directive, when supplied a local URL path, expects the path to be fully qualified from the DocumentRoot. In your case, this means that the actual path to the ErrorDocument is

ErrorDocument 404 /hellothere/error/404page.html 
like image 56
StaticVariable Avatar answered Sep 20 '22 18:09

StaticVariable


When we apply local url, ErrorDocument directive expect the full path from DocumentRoot. There fore,

 ErrorDocument 404 /yourfoldernames/errors/404.html 
like image 36
karthik k Avatar answered Sep 23 '22 18:09

karthik k