欢迎各位兄弟 发布技术文章
这里的技术是共享的
在web.config中加入rewrite规则
格式如下:
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true"></requestFiltering>
</security>
<directoryBrowse enabled="false" />
<defaultDocument>
<files>
<clear />
<add value="index.htm" />
<add value="index.html" />
<add value="iisstart.htm" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Forbid image">
<match url="^.*comicdata.*.(txt|doc|gif|jpg|jpeg|png|mp3|flv|swf)$" ignoreCase="true" />
<conditions>
<add input="{HTTP_REFERER}" pattern="^http://(www.)?yzmanga.com/.*$" negate="true" />
<add input="{REMOTE_ADDR}" pattern="221.232.16.*" negate="true" />
</conditions>
<action type="Rewrite" url="/static/image/common/logo.png" />
</rule>
</rules>
</rewrite>
</system.webServer>