虚拟主机域名注册-常见问题虚拟主机问题 → 虚拟主机问题


window2008系统iis7.5下虚拟主机设置防盗链
作者:系统管理员

 

首先我们需要用记事本制作一个web.config,记住将*txt格式改为.config  代码如下:

 


 

<configuration>
 <system.webServer>  
  <rewrite>  
   <rules>  
    <rule name="Prevent hotlinking">  
     <match url="^.*\.(rar|zip|jpg|gif)$" 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>


   以上代码是允许了<A style="COLOR: rgb(102,102,102); TEXT-DECORATION: none" href="http://www.xxxxxx.com/" border="0" src="image/url.gif" align="absmiddle" www.xxxxxx.com和xxxxxx.com对rar|zip|jpg|gif文件进行调试

将以上文件上传至网站根目录(wwwroot)下即可 如果网站有设置伪静态,直接将上述代码加入原有web.config一样可以生效


 



来源: 网络
阅读:852
日期:2014-08-19

【 双击滚屏 】 【 推荐朋友 】 【 收藏 】 【 打印 】 【 关闭 】 【 字体: 】 
上一篇:dedecms系统后台登陆提示用户名密码不存在
下一篇:使用伪静态规则拦截蜘蛛访问
  >> 相关文章