Getting 404 Not Found error while trying to use ErrorDocument

user1725155 picture user1725155 · Oct 6, 2012 · Viewed 179.1k times · Source

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

Answer

StaticVariable picture StaticVariable · Oct 6, 2012

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