# Wrong Custom 404 Page Displaying

**URL:** <https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992>\
**Category:** RapidWeaver Classic\
**Created:** [March 23, 2016, 2:38pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992 "2016-03-23T14:38:26Z")\
**Posts on this page:** 9\
**Page:** 5

<div class="post-metadata">

**Author:** ![cynthia](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/cynthia/32/225_2.png) [@cynthia](https://forums.realmacsoftware.com/u/cynthia)\
**Post date:** [April 13, 2016, 10:00pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/81 "2016-04-13T22:00:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Doobox](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/doobox/32/32373_2.png) [@Doobox](https://forums.realmacsoftware.com/u/Doobox)\
**Post date:** [April 13, 2016, 10:40pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/82 "2016-04-13T22:40:18Z")

</div>

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

 ![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/6/63f05b0ff17478453b7c3d37aa167dc2df012fe3.jpg)

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>

```

---

<div class="post-metadata">

**Author:** ![Doobox](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/doobox/32/32373_2.png) [@Doobox](https://forums.realmacsoftware.com/u/Doobox)\
**Post date:** [April 13, 2016, 10:52pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/83 "2016-04-13T22:52:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cynthia](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/cynthia/32/225_2.png) [@cynthia](https://forums.realmacsoftware.com/u/cynthia)\
**Post date:** [April 14, 2016, 12:44am UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/84 "2016-04-14T00:44:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RicoRoyal](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RicoRoyal](https://forums.realmacsoftware.com/u/RicoRoyal)\
**Post date:** [December 12, 2016, 10:57am UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/85 "2016-12-12T10:57:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Doobox](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/doobox/32/32373_2.png) [@Doobox](https://forums.realmacsoftware.com/u/Doobox)\
**Post date:** [December 12, 2016, 3:40pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/86 "2016-12-12T15:40:51Z")

</div>

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

`ErrorDocument 404 /404.html`

Then follow the guide in this image :

 ![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/8/82fa7e070f8d312e61fc2a837fa73239332ef004.jpeg)

---

<div class="post-metadata">

**Author:** ![RicoRoyal](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RicoRoyal](https://forums.realmacsoftware.com/u/RicoRoyal)\
**Post date:** [December 12, 2016, 4:29pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/87 "2016-12-12T16:29:24Z")

</div>

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](http://www.3xfilm.nl/404.html)

Or I just don’t get it 🙂 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

---

<div class="post-metadata">

**Author:** ![swilliam](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/swilliam/32/14799_2.png) [@swilliam](https://forums.realmacsoftware.com/u/swilliam)\
**Post date:** [December 12, 2016, 6:05pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/88 "2016-12-12T18:05:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Doobox](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/doobox/32/32373_2.png) [@Doobox](https://forums.realmacsoftware.com/u/Doobox)\
**Post date:** [December 13, 2016, 3:57am UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/89 "2016-12-13T03:57:10Z")

</div>

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.

[Previous page](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992.md?page=4)
