gpt4 book ai didi

seo - 禁用对子域的抓取

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:33:06 25 4
gpt4 key购买 nike

我想禁用对我的子域的抓取。

例如:我的主域是 maindomain.com
subdomain_one.com(附加域)
subdomain_two.com(附加域)

所以我想禁用对 subdomain_one.maildomain.com 的抓取。

我在 robot.txt 中使用了这个:

   User-agent: *
Disallow: /subdomain_one/
Disallow: /subdomain_two/

最佳答案

该文件必须名为 robots.txt,而不是 robot.txt

如果您想禁止所有机器人抓取您的子域,您必须将 robots.txt 文件放在该子域的文档根目录中,其内容如下:

User-agent: *
Disallow: /

每个主机都需要自己的 robots.txt。您不能在 robots.txt 中指定子域,只能指定 beginnings of URL paths .

因此,如果您想阻止 http://sub.example.com/ 上的所有文件,robots.txt 必须可以从 http://sub.example.com 访问/robots.txt.

doesn’t matter您的网站在服务器端的组织方式,只有哪些内容可以公开访问才重要。

关于seo - 禁用对子域的抓取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25263808/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com