views:

167

answers:

3

If you have to take a site down for some type of unavoidable maintenance task (and it's not a big enough site that you have a backup server), what HTTP status code should you have your server return to minimize the possibility that search engines will think the site is gone?

I found this list of status codes from W3C, of which the following seem applicable:

  • 503 Service Unavailable
  • 500 Internal Server Error
  • 408 Timeout
  • 404 Not Found

I think 503 is the most appropriate, but I don't know what search engines might prefer.

+2  A: 

According to Google the 503 code would be the way to go, since it means "the server is temporarily unavailable." Also check out the W3C page on the same.

Matt Ball
+10  A: 

From the horse's mouth:

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.

ceejayoz
+2  A: 

Don't send a 404 -- they may remove you from their index.

I'd probably send a 503 and an appropriate Retry-After, although I don't know if anything actually uses the header.

Joe