Windows 2008R2 IIS7.5配置防盗链方法

日期:2024-02-29 编辑:ucbug下载站
Windows 2008R2 IIS7.5配置防盗链方法
1、下载微软自己提供的IIS REWRITE模块:http://www.microsoft.com/downloads/zh-cn/details.aspx?familyid=1b8c7bd8-8824-4408-b8fc-49dc7f951a00
2、修改网站的web.config
引用
    <system.webServer>  
    <rewrite>  
    <rules>  
    <rule name="Prevent hotlinking">  
    <match url="^.*.(rar|zip)$" ignoreCase="true" />  
    <conditions>  
    <add input="{HTTP_REFERER}" pattern="http://www.ucbug.cc/.*" negate="true" />  
    <add input="{HTTP_REFERER}" pattern="http://soft.ucbugxz.com/.*" negate="true" />  
    </conditions>  
    <action type="Rewrite" url="/no.html" />  
    </rule>  
    </rules>  
    </rewrite>  
    </system.webServer>  

设置了只允许http://www.ucbug.cc、http://soft.ucbugxz.com/  调用网站的rar、zip类型的文件。
相关下载
相关文章
猜你喜欢