Avoiding Indexing Error Pages Using 500

Once upon a time, in a place far away, your web server is chugging along; everything is fine and dandy. Then, all of a sudden, something terrible happens, and the database goes down. Because this is an unanticipated error condition (all of us could do better error checking!), many pages return erroneous blank pages or perhaps 404s. Perhaps the web server goes down altogether. Worse still, you don’t have a hot standby to replace it. Meanwhile, search engines are trying to index your pages, not finding anything, getting blank pages, and so on. Here are the possibilities:


 



Your Ad Here


Returning 404s or blank pages.

This is a real problem. If a server returns a 404, a search engine will de-list your pages. If a search engine sees blank pages, or pages full of errors, it may do the same. This should be avoided at all costs.

Not finding anything(no connection).

This is actually more desirable than it sounds in terms of indexing. Although it may look extremely unprofessional, a search engine is likely to assume that there are intermittent connectivity problems and try again later. Your users may, however, be annoyed. At least from spider’s point of view, though, as long as this is resolved in a day or so, there is no major problem.


It’s actually fairly simple. A “500” status code can be returned, along with a custom page describing the error. This indicates to search engines that there is a temporary problem. Perhaps the site is down for maintenance. Say it politely and provide the time it will be back up. Or perhaps there was a national disaster as in the case of certain servers in the New Orleans area in 2006. Put up a global error page for every URL with a polite message, and wait for things to clear up.

To do this in PHP use this line of PHP, and then add whatever content you wish:

header (‘HTTP/1.0 500 Internal Server Error’);
echo ‘The website is down for maintenance and will be back soon with more new updates.’;
exit();


JavaScript, ASP.Net & PHP Web Developer. Connect with me on Facebook and Twitter.

Share This Post

Related Articles

Powered by Paras Babbar · Designed by Paras Babbar