The Importance of 404
When I first launched Best Seattle Bars a few months back, I had worked only shortly on a pseudo PHP controller to support keyword-rich, pretty URLs. The controller also handled the case when a page wasn’t found. In this case, the controller would simply output a 404 message. I thought this was good enough.
About a week after our launch, I did a few Google queries to analyze our search engine performance. I noticed that the only pages indexed by Google were those of the previous version of the site, which was a terrifyingly bad set of informational pages generated by some sort of Yahoo page builder. I was curious why our performance was so poor, so I decided to take a look at Google Tools for Webmasters and ran their diagnostics report. Everything checked except for one thing – I was missing a 404 page. I first thought that Google was wrong – I had a 404 page! It displayed “404!” Then I quickly realized that Google isn’t going to recognize a 404 page by its contents but instead by its HTTP header information. I added the following line of PHP code to my 404 page, and my problems were solved.
<?php header("HTTP/1.0 404 Not Found"); ?>
No comments yet. Be the first.
Leave a reply