【问题标题】:how to stop google crawl unexisting page如何阻止谷歌抓取不存在的页面
【发布时间】:2012-07-15 03:21:50
【问题描述】:

当我开发我的网站时。我在一个地方打错了,例如,我所有的页面都是 dir1/dir2/page.htm/par1-par2,但我的错字是 dir1/dir2/page/par1-par2(注意:没有 .htm)。

它只投入生产了 1 天,但 Google 一直在抓取这些链接。如何阻止 Google 这样做?

顺便说一句,这不是一页,而是成百上千页。

【问题讨论】:

    标签: php .htaccess web-crawler


    【解决方案1】:

    尝试使用 robots.txt 拒绝访问此页面(url)

    http://www.robotstxt.org/robotstxt.html

    http://support.google.com/webmasters/bin/answer.py?hl=en&answer=156449

    在这里测试 robots.txt:http://www.frobee.com/robots-txt-check/

    patterns must begin with / because robots.txt patterns always match absolute URLs. 
    * matches zero or more of any character. 
    $ at the end of a pattern matches the end of the URL; elsewhere $ matches itself. 
    * at the end of a pattern is redundant, because robots.txt patterns always match any URL which begins with the pattern.
    

    【讨论】:

    • 取决于其他事情,这应该可以工作。我用补语编辑答案
    • 我想要的是阻止 /subdir/(不以 .htm 结尾)/whatever 中的任何内容。怎么做?泰
    • 如果模式匹配有效,则此解决方案应该有效。只是害怕写错,因为以前从未做过。
    • 在此处查看更多信息support.google.com/webmasters/bin/…
    • 以 .htm 结尾?就我而言,所有链接都像 /*.htm/1x-2x
    【解决方案2】:

    如果页面存在(可能是因为您使用了 mod_rewrite)并且未找到呈现自定义页面但未发送 http 410 Gone 标头 header("HTTP/1.0 410 Gone");,那么 google 将不会知道它已被删除并对其进行索引。

    您需要添加正确的标题或删除页面或不呈现您自己的 404,因此它会访问您的服务器 404,然后谷歌将从索引中删除该页面,并且该页面的删除不会在一夜之间发生:

    您还可以将 url 添加到 robots.txt 文件中,这也不能保证从索引中删除该页面,您可以按照其他人所说的联系谷歌,但不能保证得到响应或删除。

    User-agent: *
    Disallow: /dir1/dir2/page/par1-par2
    

    祝你好运。

    【讨论】:

    • 是的。使用 htaccess 重写,所以那些页面从未存在过! page 是一个变量,par1-par2 也是。只是很多页面。必须使用模式匹配
    • google 将它们视为一个页面,当您访问相关页面时,如果它输出除 404 未找到或 410 http 标头已编入索引之外的任何内容。您可以使用 Disallow: /dir1/ 然后 url 树上的任何页面都不会被索引。希望有帮助
    【解决方案3】:

    Google 有一个表单,您可以要求它从索引中删除一个页面。

    查看此链接中的信息:

    http://support.google.com/webmasters/bin/answer.py?hl=en&answer=164734

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-09
      • 2018-12-19
      • 2015-03-27
      • 1970-01-01
      • 2015-04-20
      • 2016-01-25
      • 1970-01-01
      相关资源
      最近更新 更多