Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Jute Powerful Forum  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 对于防止图片盗链的办法
alexyu2000

我是多罗,我很可爱

Jute Pro User


发贴: 405
积分: 70
于 2003-12-05 12:06 user profilesend a private message to usersend email to alexyu2000search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
对于图片引用,这个是检查了referer字段,防止图片被盗连。
参见:
http://httpd.apache.org/docs/misc/FAQ-G.html#image-theft

How can I prevent people from "stealing" the images from my web site?
The goal here is to prevent people from inlining your images directly from their web site, but accessing them only if they appear inline in your pages.

This can be accomplished with a combination of SetEnvIf and the Deny and Allow directives. However, it is important to understand that any access restriction based on the REFERER header is intrinsically problematic due to the fact that browsers can send an incorrect REFERER, either because they want to circumvent your restriction or simply because they don't send the right thing (or anything at all).

The following configuration will produce the desired effect if the browser passes correct REFERER headers.

SetEnvIf REFERER "www\.mydomain\.com" linked_from_here
SetEnvIf REFERER "^$" linked_from_here

<Directory /www/images>
Order deny,allow
Deny from all
Allow from env=linked_from_here
</Directory>

Further examples can be found in the Environment Variables documentation.



[img]http://www.nhacks.com/email/email.php?mail_e=q8UtjGduMME%3D&iv=ICTOzCo%3D&domain=TVNO&ext=0[/img][img]http://bbs.dongman.org:8080/post-85-10950836311.gif[/img]
[img]http://bbs.8080.net/upload/17957/17957.jpg[/img]
作者 Re:对于防止图片盗链的办法 [Re:alexyu2000]
hao0323



发贴: 0
积分: 0
于 2004-02-14 11:24 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
英文的




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923