﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DannyJames.net &#187; SEO</title>
	<atom:link href="http://dannyjames.net/category/seo/feed/" rel="self" type="application/rss+xml" />
	<link>http://dannyjames.net</link>
	<description>The Personal Site Of Danny James</description>
	<lastBuildDate>Fri, 26 Jun 2009 18:57:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Database Error Page and Search Engines</title>
		<link>http://dannyjames.net/2007/12/30/wordpress-database-error-page-and-search-engines/</link>
		<comments>http://dannyjames.net/2007/12/30/wordpress-database-error-page-and-search-engines/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 20:12:28 +0000</pubDate>
		<dc:creator>Danny</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[errors]]></category>

		<guid isPermaLink="false">http://dannyjames.net/2007/12/30/wordpress-database-error-page-and-search-engines/</guid>
		<description><![CDATA[WordPress 2.3.2 is now available and with it comes the new ability to create your own custom database error page.
This is a nice feature in my opinion, as not only does it hide possibly sensitive information about your database it also allows you to create a friendly error message for the less computer savvy among [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/development/2007/12/wordpress-232/" class="extlink">WordPress 2.3.2 is now available</a> and with it comes the new <a href="http://trac.wordpress.org/ticket/5500" class="extlink">ability to create your own custom database error page</a>.</p>
<p>This is a nice feature in my opinion, as not only does it hide possibly sensitive information about your database it also allows you to create a friendly error message for the less computer savvy among us. A possible example would be a simple message telling the user that something has gone wrong and they should check back later. It&#8217;s as easy as creating your custom error page and uploading it to <strong>/wp-content/db-error.php</strong></p>
<p>Then I got thinking. What about our old friend Mr Search Engine?</p>
<span id="more-69"></span>
<p>What would happen if he decided to pay a visit while the database was having a seizure? Well for starters the page would be returning the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" class="extlink"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> 200 status code</a>, which would cause the search engine spider to assume everything is fine and dandy. Not only that, just about <em>every page</em> would be serving the custom database error which would be seen as <a href="http://www.searchenginejournal.com/duplicate-content-penalty-how-to-lose-google-ranking-fast/1886/" class="extlink">duplicate content</a>. Uh oh.</p>
<p>Luckily the WordPress developers allow us to use <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> in the custom error page, so it becomes trivial to rectify this.</p>
<p>The <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4" class="extlink">HTTP 503 status code</a> does the trick here, coupled with the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.37" class="extlink">Retry-After header</a>. Retry-After is measured in seconds so in my example I&#8217;m telling the spider to come back after one hour (3600 seconds), like so:</p>
<pre class="prettyprint lang-php">
&lt;?php

header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600');

?&gt;
... your error page html content here ...
</pre>
<p>The search engine spider now knows that all is not as it should be and that it should check back in an hour.</p>
<p>The possibilities here are endless if you know your way around PHP. The error page could send an email or <abbr title="Short message service">SMS</abbr> to the site administrator and much more, however this is outside of the scope of this article.</p>]]></content:encoded>
			<wfw:commentRss>http://dannyjames.net/2007/12/30/wordpress-database-error-page-and-search-engines/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
