What is the correct HTTP status code to send when a site is down for maintenance?

Is there an HTTP status code to tell Google (and others) to leave, index me later?

Basically, the one that semantically tells customers that the site is down for maintenance?

The ones I reviewed

304 => Not modified 307 => Temporary redirect 410 => Gone 503 => Service Unavailable 

I tend to the latter, but I was curious which one was the right choice.

+60
May 7 '10 at 6:21
source share
4 answers

HTTP 503 would be most appropriate:

The web server (running on the website) is currently unable to process the HTTP request due to temporary overload or server maintenance. It is understood that this is a temporary condition that will be mitigated after some delay.

This post on the Google Webmaster Central Forum is also relevant:

Yes - 503 - the correct server response for "We are closed." If you replace the regular HTML page that says “We are closed” and serve 200, it is likely to be indexed by Google.

If you give the Googlebot 503 a robot, it will simply leave and return later without indicating what you give it.




UPDATE:

Regarding the php implementation, you may be interested in checking out the following article:

Also pay attention to the retry-after header, where you can specify how many seconds it will take to retry another request.

+82
May 7 '10 at 6:22 a.m.
source

From http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=40132

503 (service unavailable) The server is currently unavailable (because it is overloaded or unavailable for maintenance). This is usually a temporary condition.

+5
May 7 '10 at 6:23 a.m.
source

I think 503 is the most suitable since the 5xx group is for server errors in general.

+3
May 7 '10 at 6:23 a.m.
source

503 Service unavailable

+3
May 07 '10 at 6:23
source



All Articles