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. 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!!
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.
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.
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!
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.
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!
I almost hate to bring this topic back up again butā¦
Although the solutiondoes 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 Just enter a bad url EX: 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
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!!
@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?
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!
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!