【问题标题】:Prevent indexing of sub-directories of parent domain防止索引父域的子目录
【发布时间】:2012-09-19 18:36:35
【问题描述】:

假设我的网站 children.com(我希望将其编入索引)也可以通过 http://mother.com/children/(我不希望将其编入索引)访问。

示例层次结构: /home/用户名/母亲:http://mother.com |_ 孩子们:http://www.children.com

我会在 mom.com/robots.txt 文件中添加什么内容,以防止 children.com 和 children.com 的所有子目录中的内容被索引为属于 mother.com?

感谢您的任何建议

【问题讨论】:

    标签: seo robots.txt


    【解决方案1】:

    我已经解决了我自己的问题并通过 phpwebby robots.txt 分析器确认了它...我已将以下代码放入 mother.com/robots.txt 文件:

    User-agent: Googlebot
    Disallow: /
    User-agent: Mediapartners-Google
    Disallow: /
    User-agent: Adsbot-Google
    Disallow: /
    User-agent: Jeeves
    Disallow: /
    User-agent: Slurp
    Disallow: /
    User-agent: Yahoo-MMCrawler
    Disallow: /
    User-agent: msnbot
    Disallow: /
    User-agent: psbot
    Disallow: /
    User-agent: *
    Disallow: /
    

    并将以下内容添加到我的 chilren.com robots.txt 文件中。

    User-agent: *
    #block indexing of email and print pages -------
    Disallow: /*~email.shtml
    Disallow: /*~print.shtml
    Sitemap: http://www.children.com/sitemap_index.xml
    

    当然,我三次检查以确保(使用 robots.txt 文件分析器)各种子目录无法通过 mother.com 域访问,并且它们可以通过 children.com 域进行索引。

    注意:仅以mother.com 和children.com 域为例。

    【讨论】:

      【解决方案2】:

      您实际上可能甚至不想使用 robots.txt。而是使用robots meta tagcanonical tags 的组合。

      在所有 mother.com/children 页面上,添加值为“noindex”的元机器人标签。尽管搜索引擎将能够抓取该页面,但它不会将这些页面添加到索引中。现在,这仍然会在内容的权威位置方面造成一些混乱。

      因此,您需要使用跨域规范标签来告知主要搜索引擎权威内容所在的位置。因此,您将在mother.com/children 的页面上添加一个规范标签,并在children.com 上为它们赋予值。您需要确保如果它是特定页面,则将其规范化为 children.com 上的相同内容,因为规范标签实际上仅适用于相同的内容。

      【讨论】:

        猜你喜欢
        • 2011-03-10
        • 1970-01-01
        • 2011-06-19
        • 1970-01-01
        • 1970-01-01
        • 2012-02-15
        • 2016-04-25
        • 1970-01-01
        • 2013-02-06
        相关资源
        最近更新 更多