Searching for specific information on the robots.txt
, I stumbled upon a Yandex help page http://help.yandex.com/webmaster/controlling-robot/robots-txt.xml#host‡ on this topic. It suggests that I could use the Host
directive to tell crawlers my preferred mirror domain:
User-Agent: *
Disallow: /dir/
Host: www.example.com
另外,维基百科文章 https://en.wikipedia.org/wiki/Robots_exclusion_standard#Host表示谷歌也了解Host
指令,但没有太多(即骨头)信息。
At robotstxt.org http://www.robotstxt.org/,我没有找到任何东西Host
(or Crawl-delay
如维基百科所述)。
- 是否鼓励使用
Host
根本有指令吗?
- 谷歌有这方面的资源吗
robots.txt
具体的?
- 与其他爬虫的兼容性如何?
‡ At least since the beginning of 2021, the linked entry does not deal with the directive in question any longer.
The 原始 robots.txt 规范 http://www.robotstxt.org/orig.html#format says:
无法识别的标头将被忽略。
他们称之为“标头”,但这个术语在任何地方都没有定义。但正如在有关格式的部分以及同一段落中提到的User-agent
and Disallow
,似乎可以安全地假设“标题”意味着“字段名称”。
所以是的,你可以使用Host
or any其他字段名称。
- 支持这些字段的 Robots.txt 解析器,嗯,支持它们。
- 不支持此类字段的 Robots.txt 解析器必须忽略它们。
但请记住:由于 robots.txt 项目未指定它们,因此您无法确定不同的解析器以相同的方式支持该字段。所以你必须手动检查每个支持的解析器。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)