服务器 频道

apache中如何防止盗链

  【IT168 服务器学院】问题:apache中如何防止盗链

  解决:

  可以检查 http referer 看是从那连接来得
  参考 http://apache-server.com/tutorials/ATimage-theft.html

  SetEnvIfNoCase Referer "^http://my.apache.org/" local_ref=1
  <FilesMatch ".(gif|jpg)">
  Order Allow,Deny
  Allow from env=local_ref
  </FilesMatch>

  改改要检查的档案范围就可以了
  或是再加个
  SetEnvIfNoCase Referer "^$" local_ref=1
  有些会删掉 http referer 的 proxy 用户需要这个
   
   
  

0
相关文章