views:

481

answers:

4

I need to setup a maintenance page for a website I'm running, e.g. for display when I'm performing site maintenance (scheduled downtime) or if something really breaks and I need to put up a holding page.

Is there anything special I need to do to ensure that search engine crawlers don't index it and think that it's my site. Or should I do a 404, add a temporary robots.txt file or something? I basically don't want them to index it as my site, but I also don't want them to think my site is dead and not come back.

Edit: Here's what I did in Apache: ErrorDocument 503 /.server-maintenance.html RewriteEngine On RewriteRule !^.server-maintenance.html /server-maintenance Redirect 503 /server-maintenance**strong text**

+3  A: 

You may use a robots.txt

http://www.robotstxt.org/

Also, google has a validator in their webmasters tools.

https://www.google.com/webmasters/tools/

John Gietzen
+9  A: 

You should send a 503 Service Unavailable HTTP status code, and not a 404. Use this in conjunction with a Retry-After header to tell the robots when to come back.

David Kolar
As I still don't have enough rep to edit, here's what I did in Apache:ErrorDocument 503 /.server-maintenance.htmlRewriteEngine OnRewriteRule !^.server-maintenance.html /server-maintenanceRedirect 503 /server-maintenance
DEfusion
A: 

Another approach would be to not link the maintenance page from any other page on your website (or any other website).

daanish.rumani
+2  A: 

Returning 503 Service Unavailable tells Google bots to come back later. There's a Google support page describing the HTTP error codes and how they are interpreted by them.

You can also use Retry-After response header to suggest the minimum time after which your site is re-checked for availability.

macbirdie