【发布时间】:2015-10-05 09:28:01
【问题描述】:
我的网址以&content=Search 结尾。我想阻止所有以此结尾的 URL。我在 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 在# 字符之后。
【问题讨论】:
-
你如何测试/知道它不起作用?
-
@unor 我在“webmaster.yandex.com/robots.xml#results”测试过
-
使用此检查器测试
/foobar&content=Search对我有用:“被规则/*&content=Search$阻止”。 -
@unor Url 我正在检查的是“/en/search?q=terms#currentYear=2015&content=search”。它对我不起作用,因为 content=search 在 # 个字符之后
标签: robots.txt yandex