【问题标题】:Is it necessary to have a robots.txt if header x-robots is set to noindex, no follow?如果 header x-robots 设置为 noindex,是否需要 robots.txt,没有跟随?
【发布时间】:2016-08-18 19:01:08
【问题描述】:

我正试图阻止我的网站被编入索引/列出:

我已经在 .htaccess 中设置了:

Header set X-Robots-Tag "noindex, nofollow"

还需要设置robots.txt吗?

User-agent: *
Disallow: /

添加robots.txt有什么坏处吗?

【问题讨论】:

    标签: apache .htaccess nofollow noindex


    【解决方案1】:

    找到答案,如果设置了 X-Robots-Tag,我必须删除 robots.txt 中的所有禁止抓取:

    Robots 元标记和 X-Robots-Tag HTTP 标头在以下情况下被发现 抓取网址。如果一个页面被禁止通过 robots.txt 文件,然后是有关索引或服务的任何信息 将找不到指令,因此将被忽略。如果 必须遵循索引或服务指令,网址包含 这些指令不能被禁止抓取。

    通过:https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag#combining-crawling-with-indexing--serving-directives

    【讨论】:

      猜你喜欢
      • 2012-08-20
      • 2014-05-03
      • 2019-11-13
      • 2017-10-05
      • 2021-07-16
      • 1970-01-01
      • 2012-11-01
      • 2020-08-06
      • 1970-01-01
      相关资源
      最近更新 更多