我在WordPress下管理一个网站。我们不得不将网站的网址改为example.com/test。因此,我现在在搜索控制台中有两个属性:一个是根域(example.com)。另一个包含子目录(example.com/test)。
每当我在谷歌中搜索site:example.com时,它都会返回主页的所有可索引URL,即example.com/test。因此,域根example.com不再是可索引的。
在robots.txt中,我喜欢禁止某些URL,比如example.com/test/programming。
我应该禁止:/programming还是不允许:/test/programmming,这样example.com/test/programming就会被阻塞?
发布于 2019-03-08 02:24:34
URL值始终表示Disallow路径的开头。
对于https://example.com/test/programming,路径为/test/programming。
因此,Disallow: /test/programming会像这样阻止URL:
https://example.com/test/programminghttps://example.com/test/programming/https://example.com/test/programming.htmlhttps://example.com/test/programming/foo/bar而Disallow: /programming会像这样阻止URL:
https://example.com/programminghttps://example.com/programming/https://example.com/programming.htmlhttps://example.com/programming/foo/barhttps://stackoverflow.com/questions/55026034
复制相似问题