Linux主机防盗链设置

在自己的.htaccess文件中加入如下代码

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.cn(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.cn(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !zhuaxia.com [NC]
RewriteCond %{HTTP_REFERER} !google.com [NC]
RewriteCond %{HTTP_REFERER} !baidu.com [NC]
RewriteCond %{HTTP_REFERER} !xianguo.com [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|png|swf|mp3)$ http://www.mydomain.cn/warning.xjpg [R,NC]

4 Comments are ready?

  1. 刚用上你的8号主机,这个防盗链正好用得上,顺便坐个沙发!

    [回复]

    阿吴 said on: 2009-12-12 14:10
  2. 还是cp方便
    虽然原理也是修改.htaccess

    [回复]

    星网 回复:

    @A.shun, cp的怎么弄的?

    [回复]

    A.shun said on: 2009-12-12 17:26
  3. 这就完了???

    [回复]

    星网 said on: 2009-12-13 14:42
  4. 我才不买抓虾他们的帐……

    [回复]

    蓝冰 said on: 2009-12-16 19:22

Post a Comment

Your email is never published nor shared. Required fields are marked *

*

*

Type your comment out:

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: