我不允许任何事,除了:
我在this answer上看过这个例子
Allow: /public/section1/
Disallow: /但是,上面是否允许在web根目录中爬行所有文件?我想让所有的文件在网页根目录。
发布于 2015-07-31 22:52:01
如果要在不允许文件的情况下禁止目录,则需要使用通配符:
User-agent: *
Allow: /public/section1/
Disallow: /*/根据上述规定,可以采取以下所有措施:
http://example.com/
http://example.com/somefile
http://example.com/public/section1/
http://example.com/public/section1/somefile
http://example.com/public/section1/somedir/
http://example.com/public/section1/somedir/somefile它将禁止以下所有行为:
http://example.com/somedir/
http://example.com/somedir/somefile
http://example.com/somedir/otherdir/somefile请注意,通配符不是原始robots.txt规范的一部分,也不是所有爬虫都支持的。他们是支持所有主要的搜索引擎,但有许多其他爬虫不支持他们。
https://stackoverflow.com/questions/31737165
复制相似问题