只允许某段地址访问
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”deny post” stopProcessing=”true”>
<match url=”(.*)” ignoreCase=”false” />
<conditions logicalGrouping=”MatchAll”>
<add input=”%{HTTP_X_FORWARDED_FOR}&%{REMOTE_ADDR}&%{HTTP_X_Real_IP}” pattern=”(118.113.)” ignoreCase=”false” negate=”true” />
</conditions>
<action type=”AbortRequest” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
屏蔽某段地址
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”band ip” stopProcessing=”true”>
<match url=”(.*)” />
<conditions logicalGrouping=”MatchAny”>
<add input=”%{HTTP_X_FORWARDED_FOR}&%{REMOTE_ADDR}&%{HTTP_X_Real_IP}” pattern=”(8.8.4.4|8.8.8.)” />
</conditions>
<action type=”AbortRequest” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
限制某一个域名访问
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”屏蔽ads.acesse.com访问”>
<match url=”^(.*)$” ignoreCase=”false” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{HTTP_REFERER}” pattern=”ads.acesse.com” />
</conditions>
<action type=”AbortRequest” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
限制蜘蛛访问
<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”Block spider”>
<match url=”(^robots.txt$)” ignoreCase=”false” negate=”true” />
<conditions>
<add input=”{HTTP_USER_AGENT}” pattern=”SemrushBot|Webdup|AcoonBot|AhrefsBot|Ezooms|EdisterBot|EC2LinkFinder|jikespider|Purebot|MJ12bot|WangIDSpider|WBSearchBot|Wotbox|xbfMozilla|Yottaa|YandexBot|Jorgee|SWEBot|spbot|TurnitinBot-Agent|curl|perl|Python|Wget|Xenu|ZmEu” ignoreCase=”true” />
</conditions>
<action type=”AbortRequest” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>