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

标签 redirect robots.txt

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/

相关文章:

seo - robots.txt - 排除任何包含 "/node/"的 URL

http - 如何在robots.txt中添加 `nofollow, noindex`所有页面?

search-engine - 停止 Google 索引子域

java - Spring:使用授权 header 重定向

java - 如何使 Jersey 2 客户端在重定向时处理 cookie

http - 重定向 IIS/Azure 中的虚拟目录

apache - apache 反向代理上的 robots.txt

php - 从索引中删除错误的索引链接

javascript - 表单提交后重定向

amazon-web-services - 如何从存储桶根重定向到 AWS S3 中的子目录?