Auke
Auke

Reputation: 25

404 Error Document does not work in .htaccess file

In my .htaccess file I have: ErrorDocument 404 "Page not found" However, when I go to a page that does not exist I will get the default 404 error from my browser (Chrome). I don't get the text "Page not found" which I configured.

Some other stuff I have in the .htaccess file does work as expected.

My expected result is that I get the text: "Page not found" when I go to a page that does not exist.

Upvotes: 0

Views: 65

Answers (1)

Nadir Latif
Nadir Latif

Reputation: 3773

You are using the wrong syntax for defining the error document. It should be:

ErrorDocument 404 /error_pages/404.html

The second parameter needs to be the path to the error document file. See this tutorial

Upvotes: 0

Related Questions