IIS URL Rewrite Module防盗链规则配置方法

 更新时间:2016年1月27日 20:13  点击:1440

IIS版本:IIS 7.5

URL Rewrite组件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrite)

规则定义截图:
Web.config中的规则定义:

复制代码 代码如下:

<rewrite>
    <rules>
        <rule name="RequestBlockingRule1" enabled="true" stopProcessing="true">
            <match url=".*" />
            <conditions>
                <add input="{HTTP_REFERER}" pattern="^$" negate="true" />
                <add input="{HTTP_REFERER}" pattern="^http://(.*\.)?(cnblogs\.com)/.*$" negate="true" />
            </conditions>
            <action type="CustomResponse" statusCode="404" />
        </rule>
    </rules>
</rewrite>

[!--infotagslink--]

相关文章