我的社区

一般分类 => 站务讨论 => 主题发帖人为: TombCrow 于 2007 二月 11, 21:50:14

标题: 给subaru,服务器的防盗链
作者: TombCrow2007 二月 11, 21:50:14
原来也是让改.h文件 :BangHead:
白问的 :crybaby2:
算了,存个档


Prevent Hot Linking and Bandwidth Leeching
What if another web site owner is stealing your images and your bandwidth by linking directly to your image files from his/her web site? You can prevent this by adding this to your .htaccess file:


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^

http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]


Replace mydomain.com with your actual domain name. With this code in place, your images will only display when the visitor is browsing

http://mydomain.com. Images linked from other domains will appear as broken images.

If you're feeling particularly nasty, you can even provide an alternative image to display on the hot linked pages -- for example, an image that says "Stealing is Bad ... visit

http://mydomain.com to see the real picture that belongs here." Use this code to accomplish that:


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^

http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$

http://www.mydomain.com/dontsteal.gif [R,L]


This time, replace mydomain.com with your domain name, and replace dontsteal.gif with the file name of the image you've created to discourage hot linking.

Thank You.
标题: Re: 给subaru,服务器的防盗链
作者: s2007 二月 12, 11:30:54
嘿嘿~~问问他怎么用这个允许在线播放?:P
标题: Re: 给subaru,服务器的防盗链
作者: TombCrow2007 二月 13, 01:35:27
我暂时用空文件覆盖了原来那个
到时候看看网站被盗链状况再决定是不是防盗链吧
PS:做个盗链显示的特别图片比较好
标题: Re: 给subaru,服务器的防盗链
作者: TombCrow2007 二月 24, 22:29:03
我现在把根目录下的.h删了,传到了downloads和news两个目录
也就是现在只有下载和新闻里面的资源有防盗,游戏图库、视频、音乐都没有设防盗链
标题: Re: 给subaru,服务器的防盗链
作者: TombCrow2007 二月 24, 22:30:38
对了,再加一个:游戏图库的高分辨率图片也防盗了,那些图超大的,还没水印~~~还是防一防比较好~~~