配置httpd防盗链可以用SetEnvIfNoCase和rewrite实现反盗链(Anti-Leech)

一、根据refer,注意放行自己的网址

HTTP_REFERER非本网站禁止访问图片

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://jb51.net/.*$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://sutras.cn$ [NC] 
RewriteCond %{HTTP_REFERER} !^http://www.sutras.cn/.*$ [NC] 
RewriteRule .*\.(gif|jpg|swf)$ http://www.sutras.cn/about/nolink.png [R,NC] 

或者,推荐使用这一种

SetEnvIfNoCase Referer "^http://.*\.microec\.com" local_ref
SetEnvIfNoCase Referer ".*\.microec\.com" local_ref
SetEnvIfNoCase Referer "^$" local_ref <filesmatch "\.(png|txt|doc|mp3|zip|rar|jpg|gif)"> Order Allow,Deny
Allow from env=local_ref 
</filesmatch>