Problem
When taking a Joomla! website offline (in the Global Configuration), the '200 OK' HTTP Status Code is returned. This is incorrect for a website that is 'down for maintenance' and, as a result, search engines could start to cache your offline message for every page of your website that it knows about.
Solution
Simple solution is some extra PHP code in offline.php in the System template (and all default templates) as follows:
Code: Select all
<?php
header('HTTP/1.1 503 Service Temporarily Unavailable',true,503);
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 86400');
?>
References
Google Webmaster Central suggests that this is the correct method of telling Google about a site being in an 'offline' state:
http://googlewebmastercentral.[URL banned]. ... lebot.html
And Google's definition of status codes also demonstrates that this is the correct status code for a site that's down for maintenance:If my site is down for maintenance, how can I tell Googlebot to come back later rather than to index the "down for maintenance" page?
You should configure your server to return a status of 503 (network unavailable) rather than 200 (successful). That lets Googlebot know to try the pages again later.
http://googlewebmastercentral.[URL banned]. ... lebot.html
503 (Service unavailable) The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.