我只想允许主 URL(域)和 http://domain/about
,其他 URL 对搜索 google 不可见。示例我的链接如下:
http://example.com
http://example.com/about
http://example.com/other1
http://example.com/other2
http://example.com/other3
http://example.com/other4
http://example.com/other5
http://example.com/other6
and more URL.
我的问题是 robots.txt 的内容,我只想允许 http://example.com
和 http://example.com/about
,我的网站使用 WordPress。
谢谢。
最佳答案
你想要的是:
User-agent: *
Allow: /$
Allow: /about
Disallow: /
$
表示 url 字符串必须在此结束。因此它不允许,例如 /example.com/foo
。
关于robots.txt - Robot.txt 允许域中指定的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14598802/