虚拟主机域名注册-常见问题云主机/VPS → 主机租用问题


vps/云主机 iis6 防盗链设置方法,实测可用
作者:

把伪静态组件开启这一步l略过

apache和iis6实现防盗链规则相同:

进入Rewrite/httpd.conf中,保留前两行,复制以下规则保存即可

RewriteEngine on

RewriteCond %{HTTP_REFERER} !baidu.com [NC]

RewriteCond %{HTTP_REFERER} !google.com [NC]

RewriteCond %{HTTP_REFERER} !google.cn [NC]

RewriteCond %{HTTP_REFERER} !gougou.com [NC]

RewriteCond %{HTTP_REFERER} !soso.com [NC]

RewriteCond %{HTTP_REFERER} !sogou.com [NC]

RewriteCond %{HTTP_REFERER} !youdao.com [NC]

RewriteCond %{HTTP_REFERER} !bing.com [NC]

RewriteCond %{HTTP_REFERER} !yahoo.com [NC]

RewriteCond %{HTTP_REFERER} !yahoo.cn [NC]

RewriteCond %{HTTP_REFERER} !eojoo.com [NC]

RewriteCond %{HTTP_REFERER} !easou.com [NC]

RewriteCond %{HTTP_REFERER} !sm.cn [NC]

RewriteCond %{HTTP_REFERER} !haosou.com [NC]

RewriteCond %{HTTP_REFERER} !newent.cc [NC]

RewriteRule .*\.(gif|jpg|jpeg|png|bmp)$ /images/logo.gif [NC,L]

newnet.cc是您自己的域名

logo.gif是被盗链后的提示内容文件

*****************************************************

iis7实现防盗链:

在网站根目录wwwroot下创建一个web.config文件,复制以下代码保存即可, 如果网站有设置伪静态,已存在web.config,则只复制中间颜色部分代码,加到第一个之后即可

<?xml version="1.0" ?>


<configuration>

 <system.webServer>  

  <rewrite>  

   <rules>   

    <rule name="Prevent hotlinking">  

     <match url="^.*\.(rar|zip|jpg|gif)contentquot; ignoreCase="true" />  

      <conditions>  

       <add input="{HTTP_REFERER}" pattern="http://www.xxxxxx.com/.*" negate="true" />  

       <add input="{HTTP_REFERER}" pattern="http://xxxxxx.com/.*" negate="true" /> 

      </conditions>  

     <action type="Rewrite" url="/404.html" />  

    </rule>

   </rules>  

  </rewrite>  

 </system.webServer> 

</configuration>



来源:
阅读:2313
日期:2016-12-19

推荐朋友 】 【 评论 】  【 字体: 】 
上一篇:相对路径绝对路径哪个好有什么区别哪个最适合SEO优化
下一篇:html5新增标签有哪些 html5与传统html区别
  >> 相关文章
  没有相关文章。
发表评论


点  评: 字数0
用户名:  密码:

  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款