在计划中断期间,什么 HTTP 状态代码对搜索引擎最友好?

发布于 2024-08-02 00:20:50 字数 367 浏览 3 评论 0原文

如果您必须关闭某个站点以执行某种类型的不可避免的维护任务(并且该站点不是一个足够大的站点,您没有备份服务器),您应该让您的服务器返回什么 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦魇绽荼蘼 2024-08-09 00:20:50

真实消息

如果我的网站因维护而停机,我如何告诉 Googlebot 稍后返回而不是将“因维护而停机”页面编入索引?

您应该将服务器配置为返回状态 503(网络不可用)而不是 200(成功)。 这可以让 Googlebot 知道稍后再尝试这些页面。

From the horse's mouth:

If my site is down for maintenance, how can I tell Googlebot to come back later rather than to index the "down for maintenance" page?

You should configure your server to return a status of 503 (network unavailable) rather than 200 (successful). That lets Googlebot know to try the pages again later.

绳情 2024-08-09 00:20:50

不要发送 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.

从﹋此江山别 2024-08-09 00:20:50

根据 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文