防止第三方站点盗用自己站点的资源
1.配置虚拟主机文件 #vim /usr/local/apache/conf/extra/httpd-vhosts.conf
SetEnvIfNoCase Referer "^http://.*\.zhijie\.com(白名单域名)" local_ref
SetEnvIfNoCase Referer ".*\.maozhijie\.com(白名单域名)" local_ref
SetEnvIfNoCase Referer "^$" local_ref
<filesmatch "\.(txt|doc|mp3|zip|rar|jpg|gif|jpeg)(防盗文件类型)">
Order Allow,Deny
Allow from env=local_ref
</filesmatch>
2.重启Apache
(1)#/usr/local/apache/bin/apachectl -t
(2)#/usr/local/apache/bin/apachectl restart
本文出自 “linux研究” 博客,请务必保留此出处http://xuqing.blog.51cto.com/3635396/1715739
原文地址:http://xuqing.blog.51cto.com/3635396/1715739