Wrong Custom 404 Page Displaying

hello,

I followed your instructions and created the two pages, but mine doesn’t work. With a bad URL, mine just pulls-up a black page, which I think is the original 404 with the no display. Do you know what I can check from here?

Your theme is placing your js just before the closing body tag …
For an unknown reason it isn’t getting triggered down there.

Instead of placing that js in the javascript section of the page inspector. Try placing it in the header section of the page inspector and wrapping it in script tags like this…

<script>
window.location = "http://www.yoursite.com/404redirected.html";
</script>
3 Likes

There you go, all working now :slight_smile:
I will amend my post tomorrow to take themes that place custom js at the end of the body into consideration.

4 Likes

Yes, I believe it is working now. :slight_smile: Thank You!!!

3 Likes

Hello Doobox. Your blogpage returns a 404 page now!-)

Can you post the content of your blogpost here please? A working link to the information is also appreciated.
Trying to solve the 404 page issue for a long time also.

Thanks,

Rico

Add this to htaccess file in the root of your website:

ErrorDocument 404 /404.html

Then follow the guide in this image :

2 Likes

Thanks Doobox,

I setup my 404 page according to your graph. It works, but I still get a status code 200 on this setup in stead of a 404.

http://www.3xfilm.nl/404.html

Or I just don’t get it :slight_smile: I’m a little confused here. Status code 200 means page found. This is of course correct, because there is a custom 404 page.
But shouldn’t a well setup 404 page return a 404 status code?

Hope you know the answer!

Rico

I suspect you are seeing the 200 for the actual 404 error page (your error page which is found)

1 Like

The browser has to be seeing a status code of 404, else the htaccess rule would never be triggered, directing to the “real 404” page and redirecting to the “custom 404” page. This only ever works when a 404 status code is encountered by the browser.