# 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:** 20\
**Page:** 1

<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:** [March 23, 2016, 2:38pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/1 "2016-03-23T14:38:26Z")

</div>

Hello,

Recently, I made two major changes to my website. I basically made a whole new site as an updated version of the old one. A few days later, I also changed webhosts. Just before changing webhosts, I tried to make a new custom 404 page. A long story short, I was having some difficulty, and tried it several times. After switching webhosts, I believe I created a successful custom 404 page. It is named 404.shtml in the root of my new site. If I go to my current site online, and type in an incorrect page URL, I believe the new 404 page is working just fine. When I recreated my site, I dropped a lot of old pages because I am making some updated content. Anyway, when I do a Google search for my site, some of the old (obsolete) pages are still showing up. When I click on one of those, I’m getting a weird looking 404 page, and not the current one I have on my site. The weird one that comes up looks similar to one I tried to create at the old hosting. It also looks like the CSS or something is not applied, so it looks distorted. Recently, I cancelled my old webhost, I have the domains pointing to the new hosting, and I have created and submitted a new sitemap.xml file to Google several times which is at the root of my site. The URL for my site is [http://www.educationoasis.com](http://www.educationoasis.com). Is there a way to stop the obsolete 404 page from displaying, and instead use my new one? I don’t know if this is a RW thing, or Google, or if it’s in a cache somewhere, or what. My new webhost says it doesn’t have anything to do specifically with their servers. Any help would be truly appreciated!!

---

<div class="post-metadata">

**Author:** ![Turtle](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/turtle/32/1438_2.png) [@Turtle](https://forums.realmacsoftware.com/u/Turtle)\
**Post date:** [March 24, 2016, 12:12am UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/2 "2016-03-24T00:12:51Z")

</div>

Do you have a RapidWeaver Community Subscription?

They cover this in the advanced tutorials… $10/month for Silver, pay month to month cancel anytime…

Brad

---

<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:** [March 24, 2016, 1:12pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/3 "2016-03-24T13:12:33Z")

</div>

No, I don’t have a paid subscription to the RW Community right now. I think I will look into that. I think I finally figured out (or sort of) how to solve the wrong 404 page from displaying, although I really don’t understand it. I changed the folder and filename to one I had tried to create at the old hosting site, and now it seems to pull it up correctly. The only problem is, it still doesn’t let me completely lay it out the way I want. For example, it doesn’t include an image, just a placeholder for it, and some of the text is crunched together. When I try to adjust it with margins and/or padding, it doesn’t change at all, and still looks the same on the page. It changes in Preview, but the published page doesn’t change. Oh well, I guess I’ll keep working with it the best I can. At least the page is displaying now. Thanks for your help and the info! I will check out the RW Community.

---

<div class="post-metadata">

**Author:** ![manofdogz](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/manofdogz/32/26314_2.png) [@manofdogz](https://forums.realmacsoftware.com/u/manofdogz)\
**Post date:** [March 24, 2016, 1:55pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/4 "2016-03-24T13:55:46Z")

</div>

Cynthia - You might find this useful: [http://www.marathia.com/blog/index.php?id=3277479349107382808](http://www.marathia.com/blog/index.php?id=3277479349107382808)

Personally I don’t use custom 404 pages as it encourages me to make sure my 301 redirects are good but probably should as it’s a good fallback

---

<div class="post-metadata">

**Author:** ![manofdogz](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/manofdogz/32/26314_2.png) [@manofdogz](https://forums.realmacsoftware.com/u/manofdogz)\
**Post date:** [March 24, 2016, 2:16pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/5 "2016-03-24T14:16:11Z")

</div>

on a different subject - I’m looking at some sticky / slide out type navigation and wondered what you used for the left side nav bar on your site? Particularly like the fact users can close and the lightbox effect.

---

<div class="post-metadata">

**Author:** ![jabostick](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/jabostick/32/1760_2.png) [@jabostick](https://forums.realmacsoftware.com/u/jabostick)\
**Post date:** [March 24, 2016, 3:44pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/6 "2016-03-24T15:44:37Z")

</div>

@manofdogz If you use Foundation, there’s an ‘Off Canvas’ stack that does this. Though I’m not very familiar with implementing it.

---

<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:** [March 24, 2016, 3:50pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/7 "2016-03-24T15:50:34Z")

</div>

I have made some redirects, but I have so many obsolete pages that are still showing up in a Google search that I thought it would be best to use the 404 as well. I will check out the marathia blog - thanks!

---

<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:** [March 24, 2016, 3:53pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/8 "2016-03-24T15:53:11Z")

</div>

If I’m understanding what part you’re asking about correctly, I used the AddThis menu link on the left side of the pages.

---

<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:** [March 24, 2016, 3:54pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/9 "2016-03-24T15:54:22Z")

</div>

I’ve never used Foundation, but that sounds good. Thanks for letting me know!

---

<div class="post-metadata">

**Author:** ![manofdogz](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/manofdogz/32/26314_2.png) [@manofdogz](https://forums.realmacsoftware.com/u/manofdogz)\
**Post date:** [March 24, 2016, 3:59pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/10 "2016-03-24T15:59:30Z")

</div>

Thanks for this - I didn’t move to Foundation at the time as wanted to hold onto IE8 support for a bit longer (you get this with freestacks - which I like a lot). I’m a big fan of JW tho’ so will def give foundation a shot for some future products.

---

<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:** [March 24, 2016, 5:17pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/11 "2016-03-24T17:17:03Z")

</div>

You’re welcome! I may try Foundation in the future myself. I also like Joe Workman, and have his book, RW5, and quite a few of his stacks. I love his Elevator stack, which I’m currently using on my site. Thanks!

---

<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:** [April 7, 2016, 4:42pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/12 "2016-04-07T16:42:08Z")

</div>

**EDIT THIS DOES NOT WORK CORRECTLY**  
See [here](http://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/42)

@cynthia, @manofdogz, @Turtle

I almost hate to bring this topic back up again but… 🙂

Although [the solution](http://forums.realmacsoftware.com/t/css-may-not-be-applying-to-my-page/6032/39?u=swilliam) **does** serve up a custom 404 error page, in the eyes of Google it is returning a 200 not a 404. The reason being (I believe) is that it is returning the response from the actual custom 404 page not the page that caused the 404. Google doesn’t like this…

You can see the server result codes from your non existent page [HERE](http://tools.seobook.com/server-header-checker/) Just enter a bad url EX: [http://myurl/bad-page](http://myurl/bad-page)

Doing some research I discovered that you can not change the server response code from a static html page…  
So it needs to be a .php page, but… you can’t just change the name, you have to declare it as a php page in the very first line. _I can’t find a way to do this in RW_.

- This stuff makes my head hurt LOL

Anyway, **I think** i have found a solution  
**1.** in RW rename the custom error page to .php (Ialso used the note stack to add a note to the page to remind me NEVER to publish it through RW and the details why - my old brain forgets things) After I was finished I also set the page to draft just to be sure.  
**2.** export the page  
**3.** edit the source and add the following 2 lines to the very top of the page.

\<?php header("HTTP/1.1 404 Not Found"); ?\> \<?php header("Status: 404 Not Found"); ?\>

**4.** upload the new custom error php page  
**5.** delete the current custom error .html page  
**6.** IMPORTANT - don’t forget to modify your .htaccess and change the error page file name to .php version

**7.** Now go back to the link above and check another bad page - you should see that it is now returning 404 to Google

**Disclaimer**  
I have no idea if this is the “proper” way to do things, it could very well be classified as a junk hack

Good Luck,  
Scott

---

<div class="post-metadata">

**Author:** ![manofdogz](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/manofdogz/32/26314_2.png) [@manofdogz](https://forums.realmacsoftware.com/u/manofdogz)\
**Post date:** [April 7, 2016, 5:00pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/13 "2016-04-07T17:00:04Z")

</div>

great that you have brought it back up - this is an easily missed error obviously! Will take a good look at this but thanks very much

---

<div class="post-metadata">

**Author:** ![thang](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/thang/32/303_2.png) [@thang](https://forums.realmacsoftware.com/u/thang)\
**Post date:** [April 7, 2016, 5:03pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/14 "2016-04-07T17:03:06Z")

</div>

Thanks for that Scott! I got the .htaccess solution working on a site that just went live, and your clear instructions are very helpful.

Dave

---

<div class="post-metadata">

**Author:** ![Turtle](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/turtle/32/1438_2.png) [@Turtle](https://forums.realmacsoftware.com/u/Turtle)\
**Post date:** [April 7, 2016, 8:06pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/15 "2016-04-07T20:06:10Z")

</div>

Thanks Scott for the thorough explanation… bookmarked for future reference 😉

Brad

---

<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 8, 2016, 12:45am UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/16 "2016-04-08T00:45:19Z")

</div>

hi Scott,

I can’t believe we’re at it again! 😕 But seriously, I am so thankful for you working on this so hard again, and for all your help!!

I hope I did everything correctly; I tried to follow your directions, which are very good. There was something on the top of the new page about the doctype HTML, I can’t remember exactly, so I deleted that and added the two lines of text that you gave me. I’m not sure how to edit pages outside of RW, but I tried to do it with TextWrangler, and then uploaded it with Transmit. I wish we could edit HTML in DW. I also wish it would let you put something in the main navigation menu bar without creating a page for it.

Anyway, I’m not completely sure, but I think it’s working when I try it at that link thingee that you provided. I noticed when I’m in Google Analytics, there seems to be a lot of activity with the 404 page (before I just did what you said). I don’t know if that’s normal or not. I thought it was because I made the new site, and I guess Google still shows a lot of old pages out there that are not included in the new site. Or maybe it’s related to the problem that you discovered now, I don’t know enough about this stuff to know the answer.

The only issue (that I know of now) is that the 404.php page isn’t all formatting correctly again. At least it basically looks like it should, only it no longer has the colors on the page and menu color etc. to match the other pages on the site. I think that may be a CSS thing or something, but I don’t know how to fix it, if it can even be fixed.

Thank you so very much for looking into this further for me! Hopefully this will help to make things show-up correctly. Thanks again!! 🙂

---

<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:** [April 8, 2016, 1:12am UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/17 "2016-04-08T01:12:28Z")

</div>

@cynthia,  
Nothing should have changed as far as the look of your page so if it did then something may be amiss… That line you deleted, prob should have left that in there just add the two php lines above it.

You can edit the page in text wrangler, text edit any plain text editor will do.

Do you use google webmaster tools? If not you should sign up for it. With that you can see how Google crawls and indexes your site and also if you have site errors. That’s how I discovered the 404 problems I had a load of “soft 404’s” which basically means that the page wasn’t found but no 404 was sent to google.

If your site was a redo of an old site or you moved it, did you do the 301 redirects from your old content urls to the new urls? That will save a lot of 404s and help keep the old page rank.

Looks like your php 404 page is loading, what is wrong?

---

<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:** [April 8, 2016, 1:44am UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/18 "2016-04-08T01:44:55Z")

</div>

Oh, forgot to ask, what is it you want to add to the menu, if you explain, there may be a way. Remind me, are you using foundation theme?

---

<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 8, 2016, 1:07pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/19 "2016-04-08T13:07:38Z")

</div>

Unfortunately, the page no longer seems to have all the formatting that it had before; mainly the colors of the theme, background, menu colors, etc. When I get home tonight, I will try to re-add that HTML line back in as you said and see what happens.

I do use Google Webmaster Tools, but I’m still trying to learn how to use it. I did see a soft 404 error in there. I read some of the Google help about it, but I still don’t understand it all, and so I don’t know exactly what it means or how to fix it. When you had a lot of soft 404s, were you checking for them on my site somehow? I’m not sure what you meant.

This is a rebuild of an earlier version of the site. I did a lot of 301s for the main pages, but didn’t do most of them because there are literally hundreds of old pages that I wasn’t going to use again on the new site.

I will try to work with it some more tonight when I’m at my website computer. Thank You!

---

<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 8, 2016, 1:20pm UTC](https://forums.realmacsoftware.com/t/wrong-custom-404-page-displaying/5992/20 "2016-04-08T13:20:43Z")

</div>

I am not using the Foundation theme. I am using the Copper theme by SeyDesign. I was wanting to possibly be able to add a placeholder or something in the menu that really wasn’t a page. For example, in the menu, I have Printables, and below that, All Printables. Currently, the All Printables page is a duplicate of the Printables page, that way whichever someone clicks, they will get the same information. I would like it if Printables wasn’t a real page, and just a header for the menu items below, and then only the All Printables would be the real page. Anyway, if I explained that right, that’s what I was thinking about trying to do. Thanks!

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