【问题标题】:Googlebot not respecting Robots.txt [closed]Googlebot 不尊重 Robots.txt [关闭]
【发布时间】:2010-10-02 14:10:10
【问题描述】:

由于某种原因,当我查看 Google 网站管理员工具的“分析 robots.txt”以查看我们的 robots.txt 文件阻止了哪些网址时,这不是我所期望的。这是我们文件开头的一个sn-p:

Sitemap: http://[omitted]/sitemap_index.xml

User-agent: Mediapartners-Google
Disallow: /scripts

User-agent: *
Disallow: /scripts
# list of articles given by the Content group
Disallow: http://[omitted]/Living/books/book-review-not-stupid.aspx
Disallow: http://[omitted]/Living/books/book-review-running-through-roadblocks-inspirational-stories-of-twenty-courageous-athletic-warriors.aspx
Disallow: http://[omitted]/Living/sportsandrecreation/book-review-running-through-roadblocks-inspirational-stories-of-twenty-courageous-athletic-warriors.aspx

脚本文件夹中的所有内容都被 Googlebot 和 Mediapartners-Google 正确阻止。我可以看到这两个机器人看到了正确的指令,因为 Googlebot 说脚本从第 7 行被阻止,而 Mediapartners-Google 从第 4 行被阻止。但我从第二个用户下的不允许的 url 中输入的任何其他 url -agent 指令未被阻止!

我想知道我的评论或使用绝对网址是否搞砸了……

感谢任何见解。谢谢。

【问题讨论】:

    标签: robots.txt googlebot


    【解决方案1】:

    它们被忽略的原因是您在robots.txt 文件中有Disallow 条目的完全限定URL,而specification 不允许它。 (您应该只指定相对路径,或使用 / 指定绝对路径)。请尝试以下操作:

    Sitemap: /sitemap_index.xml
    
    User-agent: Mediapartners-Google
    Disallow: /scripts
    
    User-agent: *
    Disallow: /scripts
    # list of articles given by the Content group
    Disallow: /Living/books/book-review-not-stupid.aspx
    Disallow: /Living/books/book-review-running-through-roadblocks-inspirational-stories-of-twenty-courageous-athletic-warriors.aspx
    Disallow: /Living/sportsandrecreation/book-review-running-through-roadblocks-inspirational-stories-of-twenty-courageous-athletic-warriors.aspx
    

    至于缓存,谷歌平均每 24 小时尝试获取 robots.txt 文件的副本。

    【讨论】:

    • 第一行正确吗? sitemaps.org/protocol.php#submit_robots 表示站点地图位置应该是完整的 URL。
    • 具有完整 URL 的站点地图是可以的,但您的禁止列表应该仍然是绝对的。
    【解决方案2】:

    这是绝对网址。 robots.txt 应该只包含相对 URI;域是根据访问 robots.txt 的域推断出来的。

    【讨论】:

      【解决方案3】:

      它已经存在至少一周了,Google 说它最后一次下载是在 3 小时前,所以我确定它是最近的。

      【讨论】:

      • 您最好编辑原始问题(通常是在底部以粗体显示 EIDT,然后是额外信息),而不是回答您自己的问题(我知道您还不能发表评论) .
      【解决方案4】:

      您最近是否对您的 robots.txt 文件进行了此项更改?根据我的经验,似乎 google 将这些内容缓存了很长时间。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2010-09-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-01-22
        • 2011-06-13
        • 1970-01-01
        相关资源
        最近更新 更多