Friday, 20 March 2009

Making 404 pages work proper


This post at Search Engine Roundtable reminded me that, "There are way too many sites out there that have their "Page Not Found" web pages return a 200 header status code, instead of a 404 code or a 301."

... and that some of them are mine! smile

This is a bad thing. Yours might be too, though you might not know about it. I'd not come across the problem before, until I used Google Webmaster Tools and got the following error message, “Unable to verify sitemap. We’ve detected that your 404 (file not found) error page returns a status of 200 (OK) in the header.”

Oh, does it now? Well, it wasn't deliberate. And that's the way it stayed for months, years, 'cos I wuz clueless on how to fix it.

Something else to research and do when I got the proverbial "round tuit" - you know the one that nobody ever seems to acquire.

However, today, I thought I'd Google the answer and see if I could actually understand it and sort the problem once and for all.

Who woulda thunk it was this simple? 

As this post Getting Custom 404 Page to Show 404 Error Code Instead of 200 Status explains, if you set a 404 page (in your .htaccess file or via your web host dashboard) to its full path, it returns a 200 status, 'cos it really is there, silly.

The only reason I'd done that previously is because that's exactly what's specified in the control panel at my web host - see where it says (ex. and then the URL), under the field below.


Yes, the instructions are wrong. How many of us would know that?

So, as you can see, I've changed it to the relative URL, waited the 10 minutes that the web host said it would take to be updated, resubmitted my verification request in Google Webmaster Tools

... and, hey presto it worked: Google let me verify!

Oh, while I was at it, I made a pretty 404 page.

No comments:


Related Posts Plugin for WordPress, Blogger...
^ Top