robots.txt模式匹配不起作用

时间:2012-07-16 13:32:02

标签: php .htaccess robots.txt

我需要获得模式匹配规则才能获得此结果。

allow /dir/path_name.htm/something
disallow /dir/path_name/something
and disallow /dir/path_name.htm

实际上,这两个不允许一直是积累的错别字。这些页面永远不存在。如何阻止谷歌再次抓取他们?

我在这里测试过:http://www.frobee.com/robots-txt-check/以下内容,但似乎没有任何效果。

Allow: /dir/*.htm/?*
Disallow: /dir/*

出了什么问题?谢谢。

1 个答案:

答案 0 :(得分:1)

根据规范:

http://www.robotstxt.org/norobots-rfc.txt

不允许使用通配符(*)。路径只是完全匹配。我的猜测是你正在使用某种形式的重写,并且你不希望出现具有相同内容的多个溃疡。在这种情况下,这可能是一个更好的解决方案:

http://googlewebmastercentral.blogspot.de/2009/02/specify-your-canonical.html

相关问题