用 Microsoft URL Rewrite Module 2.0 for IIS 7 (x64) 防盗链
一、安装 Microsoft URL Rewrite Module 2.0 for IIS 7 (x64)
http://www.microsoft.com/en-US/download/details.aspx?id=7435
二、在网站的webconfig 中配置
<system.webServer>
<rewrite>
<rules>
<rule name="HotLink Protection">
<match url="^.*\.(png|jpg)$" ignoreCase="true" />
<conditions>
<add input="{HTTP_REFERER}" pattern="http://www.youandme.cc/.*" negate="true" />
<add input="{HTTP_REFERER}" pattern="http://www.youandme.com/.*" negate="true" />
</conditions>
<action type="Rewrite" url="/no.png" />
</rule>
</rules>
</rewrite>
</system.webServer>