【发布时间】:2019-03-06 14:57:10
【问题描述】:
我在 WordPress 下管理一个网站。我们不得不将站点 URL 更改为 example.com/test。因此,我现在在 Search Console 中有 2 个属性:一个具有根域 (example.com)。另一个带有子目录(example.com/test)。
每当我在 Google 中搜索 site:example.com 时,它都会返回所有可索引的 URL,即主页的 example.com/test。因此,域根 example.com 不再可索引。
在 robots.txt 中,我喜欢禁止某些 URL,例如 example.com/test/programming。
我应该禁止:/programming 还是禁止:/test/programmming 以使 example.com/test/programming 被阻止?
【问题讨论】:
-
如果您阻止此 URL,您是否希望其他页面被编入索引?或者您是否希望文档
example.com/test/programming根本不被抓取,无论在哪个 URL 下? -
我希望这个网址根本不被抓取(example.com/test/programming),这样您就知道我的网站网址是 example.com/test 而不是根域
标签: robots.txt