Was ist der richtige Code HTTP-Status zu senden, wenn eine Website für die Wartung ist unten?

StackOverflow https://stackoverflow.com/questions/2786595

  •  03-10-2019
  •  | 
  •  

Frage

Sie haben einen HTTP-Statuscode Google zu sagen (und andere) gehen weg, Index mich später noch einmal

Im Grunde genommen, eine, die semantisch Kunden, dass die Website erzählt, ist für die Wartung nach unten?

Die, die ich in Betracht gezogen haben, sind

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

Ich bin Neigung in Richtung der letzten, aber war nur neugierig, die man war richtige Wahl.

War es hilfreich?

Lösung

HTTP 503 - Service Unavailable would be the most appropriate.

The Web server (running the Web site) is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay.

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

Yes - a 503 is the correct server response for "We're closed". If you substitute a normal HTML page saying "We're closed" and serve a 200 it's very likely to get indexed by Google.

If you give the Googlebot a 503, it will just go away and come back later without indexing what you give it.


UPDATE:

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

Also notice the retry-after header, where you can specify after how many seconds another request should be re-attempted.

Andere Tipps

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 down for maintenance). Generally, this is a temporary state.

I'd consider the 503 to be most appropriate, since the 5xx-group is meant for server errors in general.

503 Service Unavailable

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top