我的网址以&content=Search
结尾。我想阻止以此结尾的所有网址。我在robots.txt中添加了以下内容。
User-agent: *
Disallow:
Sitemap: http://local.com/sitemap.xml
Sitemap: http://local.com/en/sitemap.xml
Disallow: /*&content=Search$
但在https://webmaster.yandex.com/robots.xml中测试/en/search?q=terms#currentYear=2015&content=search
时,它无效。这对我不起作用,因为content=search
在#
字符之后。
答案 0 :(得分:0)
如果您测试Search
而不是search
,则Yandex Robots.txt analysis会阻止您的示例,因为Robots.txt Disallow
值区分大小写。
如果您的网站使用不区分大小写的网址,则可能需要使用:
User-agent: *
Disallow: /*&content=Search$
Disallow: /*&content=search$
# and possibly also =SEARCH, =SEarch, etc.
话虽如此,我不知道Yandex是否真的支持这个URL片段(我觉得这很不寻常),尽管他们的工具给人的印象。