robots.txt。禁止我的test子目录中的所有内容

时间:2014-02-17 04:29:47

标签: wordpress indexing web-crawler sitemap robots.txt

我在mysite.com上有一个主网站。 我创建了mysite.com的副本并安装了wordpress:“mysite.com/test”

但最近,我刚刚发现谷歌索引我的测试也是如此。我的站点地图包含指向测试站点的链接。

我的robots.txt:

User-agent: *
Disallow: /site/wp-admin/
Disallow: /site/wp-includes/

Sitemap: https://mysite.com/sitemap.xml.gz

如何确保机器人不会抓取mysite.com/test及其中的所有内容?我还必须将我的站点地图更改为仅在我的主站点上有链接吗?

1 个答案:

答案 0 :(得分:0)

  

如何确保机器人不会抓取mysite.com/test及其中的所有内容?

您将Disallow: /test放入robots.txt。 (当然,不要将其包含在站点地图中。)

相关问题