叫化窝那则apache设置图片防止盗连接的代码有误
2005-01-30 | 19:39该帖的地址在http://blog.chinaunix.net//article.php?articleId=10667&blogId=3708 ,但其实是有错误的代码。。。
正确的如下
下面的local_ref等于是打个标记,类似iptables的mark一样,然后丢给程序处理
######## Preventing Image 'Theft' ########
SetEnvIfNoCase Referer "^http://(.)+.fjhr.com/" local_ref=1
SetEnvIfNoCase Referer "^http://(.)+.hzmjp.com/" local_ref=1
SetEnvIfNoCase Referer "^http://(.)+.dalouis.com/" local_ref=1
SetEnvIfNoCase Referer "^http://(.)+.necktie.gov.cn/" local_ref=1
SetEnvIfNoCase Referer "^http://(.)+.necktie.net.cn/" local_ref=1
SetEnvIfNoCase Referer "-" local_ref=1
######## Allow the LOGO image Theft ##########
SetEnvIf Request_URI "/images/logo(.)+" local_ref=1
#上面之所以允许这句,是因为logo可能和别人做link,所以要允许别人偷,呵呵
#这里表示遇到对png,gif等文件的时候,开始处理对上面的mark进行处理
Order Allow,Deny
Allow from env=local_ref #因为1表示true,这里的意思就是如果local_ref的值为真(为1),则允许,否则禁止
该文章的原文和其引用处皆有错,各位留意好咯。。。。
欢迎各位到 http://skylove.study-area.org 进行技术探讨
该帖的地址在
http://blog.chinaunix.net//article.php?articleId=10667&blogId=3708 ,
但其实是有错误的代码。。。
正确的如下
下面的local_ref等于是打个标记,类似iptables的mark一样,然后丢给程序处理
######## Preventing Image 'Theft' ########
SetEnvIfNoCase Referer "^http://(.)+.fjhr.com/" local_ref=1
SetEnvIfNoCase Referer "^http://(.)+.hzmjp.com/" local_ref=1
SetEnvIfNoCase Referer "^http://(.)+.dalouis.com/" local_ref=1
SetEnvIfNoCase Referer "^http://(.)+.necktie.gov.cn/" local_ref=1
SetEnvIfNoCase Referer "^http://(.)+.necktie.net.cn/" local_ref=1
SetEnvIfNoCase Referer "-" local_ref=1
######## Allow the LOGO image Theft ##########
SetEnvIf Request_URI "/images/logo(.)+" local_ref=1
#上面之所以允许这句,是因为logo可能和别人做link,所以要允许别人偷,呵呵
#这里表示遇到对png,gif等文件的时候,开始处理对上面的mark进行处理
Order Allow,Deny
Allow from env=local_ref #因为1表示true,这里的意思就是如果local_ref的值为真(为1),则允许,否则禁止
该文章的原文和其引用处皆有错,各位留意好咯。。。。
欢迎各位到 http://skylove.study-area.org 进行技术探讨











最新评论