'setting 404 page displays the name of 404 file
I edited the .htaccess file on my site, and added the line
ErrorDocument 404 page-not-found.html
So when I put in example.com/pagethatdoesntexist, the screen just displays "page-not-found.html". Why does this happen?
Solution 1:[1]
As per Apache reference documentation, URLs can begin with a slash (/) for local web-paths (relative to the DocumentRoot), or be a full URL which the client can resolve.
So in your case, this should do the job.
ErrorDocument 404 /page-not-found.html
With no /, your webpage name will be treated as a message and printed in the browser.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
