在计划中断期间,什么 HTTP 状态代码对搜索引擎最友好?
如果您必须关闭某个站点以执行某种类型的不可避免的维护任务(并且该站点不是一个足够大的站点,您没有备份服务器),您应该让您的服务器返回什么 HTTP 状态代码,以尽量减少搜索引擎认为的可能性网站没了?
我从 W3C 找到了此状态代码列表,其中以下内容似乎适用:
- 503 服务不可用
- 500 内部服务器错误
- 408 超时
- 404 未找到
我认为 503 是最合适的,但我不知道搜索引擎可能更喜欢什么。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
真实消息:
From the horse's mouth:
不要发送 404——他们可能会将您从他们的索引中删除。
我可能会发送 503 和适当的 Retry-After,尽管我不知道是否有任何内容实际使用了该标头。
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.
根据 Google 503 代码将是要走的路,因为这意味着“服务器暂时不可用”。
另请查看W3C 页面。
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.