Page "Error 404"

Hi,
the page 404.html must be located on the root or the path is indifferent?

Thanks.
Massimo

normally it’s in the root but you could put it anywhere and point to it in the .htaccess 404 rule

1 Like

Don’t forget to put the following code into the ‘head’ section of the page inspector:

<?php header("HTTP/1.0 404 Not Found"); ?>

That way, the 404 page gives the correct 404 http response. If you don’t add it, your custom 404 page gives a 200 code: page found.

200 OK : The request has succeeded.

I followed this procedure indicated by Doobox. So the real page 404 is full empty and then redirect users to another RW page with website style.

Seems to works fine.
My site is https://www.iografico.it and if you type a bad link like https://www.iografico.it/asdasd the redirected page is displayed.

Is this a good practice?

1 Like

Almost done! The redirection is OK. However, the page it was redirected to does exist. And that page gives a 200 code. It should give a 404 code. You can achieve that by putting the above mentioned code into the header:

<?php header("HTTP/1.0 404 Not Found"); ?>

With that code, the page gives the correct 404 code, instead of the 200 code.

Check your http header here:

http://www.webconfs.com/http-header-check.php

Hi Dick,
thanks for the suggestion, I added the code (see the screenshot) but the page still seems to return the code 200.
Did I do something wrong?

Did you change the extension of the page to .php instead of .html?
And did you remove the .html file from the server, afterwards?

The file was already a .php file --> see screenshot

Strange. I’m doing exactly the same, and it all works. Check this url in de header check. You see a 404 returned:

https://www.simplon31.nl/404/

2018-04-03_10-47-42

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.