经发现,虽然wget遵循robots.txt规则,但是那个还是可以绕过去,现在方法如下:

 

1. 屏蔽下载任何文件

 

.htaccess


SetEnvIfNoCase User-Agent "^wget" bad_bot
<Limit GET POST>
   Order Allow,Deny
   Allow from all
   Deny from env=bad_bot
</Limit>



 

2. 屏蔽下载部分文件

 

.htaccess



SetEnvIfNoCase User-Agent "^Wget" bad_bot
SetEnvIfNoCase User-Agent "^Wget/1.5.3" bad_bot
SetEnvIfNoCase User-Agent "^Wget/1.6" bad_bot
<Files ~ "\.(html|pdf|mp3|zip|rar|exe|gif|jpe?g|png|php|jsp) $">
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</files>



 

来源:http://www.webhostingtalk.com/showthread.php?t=437549