IIS版本:IIS 7.5html
URL Rewrite組件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrite)url
規則定義截圖:spa
Web.config中的規則定義:.net
<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>
轉:http://www.cnblogs.com/dudu/archive/2013/06/06/iis_rewrite_module_http_referer.htmlcode