gpt4 book ai didi

redirect - 重定向到 https 后的 http 站点的 Google robots.txt

转载 作者:行者123 更新时间:2023-12-04 14:25:12 25 4
gpt4 key购买 nike

Google Robots.txt Specification声明机器人 txt URL http://example.com/robots.txt对域无效 https://example.com .想必反过来也是如此。

当请求 robots.txt 时,它也有关于跟随重定向的说法:

3xx (redirection)

Redirects will generally be followed until a valid result can be found (or a loop is recognized). We will follow a limited number of redirect hops (RFC 1945 for HTTP/1.0 allows up to 5 hops) and then stop and treat it as a 404. Handling of robots.txt redirects to disallowed URLs is undefined and discouraged. Handling of logical redirects for the robots.txt file based on HTML content that returns 2xx (frames, JavaScript, or meta refresh-type redirects) is undefined and discouraged.

假设我建立了一个网站,以便 http 上的所有请求都永久重定向到 https 上的等效请求。谷歌将请求 http://example.com/robots.txt并按照重定向到 https://example.com/robots.txt .该文件是 http 站点的有效 robots.txt,因为那是原始请求,还是 Google 认为 http 站点没有有效的 robots.txt?

最佳答案

在 Google Search Console 中使用 robots.txt 测试器确认重定向的 robots.txt 被用作 http(原始)域的机器人文件。

Barry Hunter 在网站管理员中心论坛上提供的答案: https://productforums.google.com/forum/#!topic/webmasters/LLDVaso5QP8

关于redirect - 重定向到 https 后的 http 站点的 Google robots.txt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47162841/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com