快活林资源网 Design By www.csstdc.com
 前提Apache中的mod_rewrite模块为激活状态,既然要消灭掉mp3文件的盗链就顺便也把图片盗链的设置给做了,下面是我在网站根目录的.htaccess文件中的配置,供同病相怜之人参考:。 
view plaincopy to clipboardprint?<ifmodule mod_rewrite.c>  #开启mod_rewrite引擎   RewriteEngine On  #设置合法请求源   
  1. <ifmodule mod_rewrite.c>  
  2. #开启mod_rewrite引擎   
  3. RewriteEngine On  
  4. #设置合法请求源   
  5. RewriteCond %{HTTP_REFERER} !^$ [NC]   
  6. RewriteCond %{HTTP_REFERER} !zhangzhang.net [NC]   
  7. RewriteCond %{HTTP_REFERER} !google.com [NC]   
  8. RewriteCond %{HTTP_REFERER} !baidu.com [NC]   
  9. RewriteCond %{HTTP_REFERER} !yahoo.com [NC]   
  10. RewriteCond %{HTTP_REFERER} !msn.com [NC]   
  11. RewriteCond %{HTTP_REFERER} !bloglines.com [NC]   
  12. RewriteCond %{HTTP_REFERER} !feedburner.com [NC]   
  13. RewriteCond %{HTTP_REFERER} !feedsky.com [NC]  
  14. #指向警告页面   
  15. RewriteRule .*\.(gif|jpg|png|mp3)$ outlink.gif [L,NC]   
  16. </ifmodule> 
快活林资源网 Design By www.csstdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
快活林资源网 Design By www.csstdc.com