SEO Friendly Downtimes
Down times are common, almost all the webhost will have at least one or two hours of downtime once in a month or two for server restart or for some other maintenance. These definitely will not cause any problem at all as the time one or two hours are not continuous and it is lower that 30 minuits in the case of a large web hosts. But there can be situations where you many need to take 5 to 10 hours or more of planned website downtime for scheduled maintenance, maybe launching a new site or switching DNS servers or even for other purposes.
Before taking you’re site down – one of the key things that you need to consider is how will this downtime effect your website’s organic search rankings. According to Google outages that are not clearly marked can negatively affect a site’s reputation. But it does not guarantee any crawling, indexing or ranking methods to deal with planned website downtime in a way that will generally not negatively affect site’s visibility in the search results.
If the search engine spiders crawl your site and find that it’s been swapped for a humble holding page, there’s a chance that it will be cached and affect your rankings.
To overcome this problem. What you can do, is to set a temporary page which describes the downtime for the visitors and give a ‘503 – temporarily unavailable’ status like a custom 404 page and then redirect any page requested to this page, you can do a PHP redirect or HTACCESS redirect, you can also check our article on REDIRECT YOUR TRAFFIC WITH PHP. Google’s spiders or any search engine spiders recognize and honor the 503 status and will simply come back later without crawling or caching your site.
PHP Header Code for 503
And you can also mention the time and date to the spiders informing to come back after the mentioned time.
.HTACCESS Code for Redirecting to 503 Page
To redirect the visitors to the 503 page it’s easier to do HTACCESS redirect than a PHP redirect, because you need to add the code to all files or to a file that is included in all page. Below is the code for a .htaccess redirect, to know more on Traffic Redirect with HTACCESS check our article on REDIRECT YOUR TRAFFIC FOR ERROR HANDELING.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/offline.php$
RewriteRule ^(.*)$ /offline.php [L]
Note: The existence of the 503 status code does not imply that a server must use it when becoming overloaded. Some servers may wish to simply refuse the connection.
Returning a 503 HTTP result code can be a great solution for a number of other problems.503 status can solve problems with sites that return 200 (OK) result codes for server errors, downtime, bandwidth-overruns or for temporary placeholder pages (“Under Construction”). The 503 HTTP result code is the webmaster’s solution of choice for all these situations. As for planned server downtime like hardware maintenance, it’s a good idea to have a separate server available to actually return the 503 HTTP result code. It is important, however, to not treat 503 as a permanent solution: lasting 503s can eventually be seen as a sign that the server is now permanently unavailable and can result in us removing URLs from search index.