问题描述
是否有HTTP状态代码告诉Google(及其他人)消失,稍后再次为我索引?
Is there a HTTP status code to tell Google (and others) to go away, index me again later?
基本上,一个从语义上告诉客户该网站是否需要维护?
Basically, one that semantically tells clients that the site is down for maintenance?
我考虑过的是
304 => Not modified
307 => Temporary redirect
410 => Gone
503 => Service Unavailable
我倾向于最后一个,但只是好奇哪个是正确的选择。
I'm leaning towards the last one, but was just curious as to which one was proper choice.
推荐答案
将是最合适的。
Google网站管理员中心论坛上的这篇文章也是相关:
This post on the Google Webmaster Central Forum is also relevant:
- Can I restrict Google from crawling my site on a specific day of the week?
如果你给Googlebot一个503,它会消失并在以后回来而不会为你提供的内容编制索引。
If you give the Googlebot a 503, it will just go away and come back later without indexing what you give it.
更新:
至于php实现,您可能有兴趣查看以下文章:
As for the php implementation, you may be interested in checking out the following article:
- The holding page and the 503 status code
另请注意标头,您可以在其中指定另一个请求的秒数应该重新尝试。
Also notice the retry-after
header, where you can specify after how many seconds another request should be re-attempted.
这篇关于当网站停机维护时,要发送的正确HTTP状态代码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!