当站点因维护而关闭时,发送的正确 HTTP 状态代码是什么?
是否有 HTTP 状态代码告诉 Google(和其他人)走开,稍后再为我建立索引?
基本上,是从语义上告诉客户该网站已关闭以进行维护的网站吗?
我考虑过的是
304 => Not modified
307 => Temporary redirect
410 => Gone
503 => Service Unavailable
我倾向于最后一个,但只是好奇哪一个是正确的选择。
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?
The ones I have considered are
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
HTTP 503 - 服务不可用 是最合适的。
Google 网站管理员中心论坛上的这篇文章也相关:
更新:
至于 php 实现,您可能有兴趣查看以下文章:
另请注意
retry-after
标头,您可以在其中指定多少秒后应重新尝试另一个请求。HTTP 503 - Service Unavailable would be the most appropriate.
This post on the Google Webmaster Central Forum is also relevant:
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.来自 http://www.google.com/ support/webmasters/bin/answer.py?hl=zh-CN&answer=40132
503(服务不可用) 服务器当前不可用(因为过载或停机维护)。一般来说,这是一种临时状态。
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.
我认为 503 是最合适的,因为 5xx 组通常用于处理服务器错误。
I'd consider the 503 to be most appropriate, since the 5xx-group is meant for server errors in general.
503 服务不可用
503 Service Unavailable
503 Service Unavailable
as 5XX 系列属于服务器端问题
503 Service Unavailable
as 5XX series belongs to server-side issues