<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.html" />
<add value="index.asp" />
</files>
</defaultDocument>
<httpErrors errorMode="DetailedLocalOnly">
<remove statusCode="404"/>
<error statusCode="404" path="/404.asp" responseMode="ExecuteURL"/>
</httpErrors>
<rewrite>
<rules>
<rule name="WWW Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^baidu.com$" />
</conditions>
<action type="Redirect" url="http://www.baidu.com/{R:0}" redirectType="Permanent" />
</rule>
<rule name="band ip" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="%{HTTP_X_FORWARDED_FOR}&%{REMOTE_ADDR}" pattern="(8.8.4.4|8.8.8.)" />
</conditions>
<action type="AbortRequest" />
</rule>
</rules>
</rewrite>
<directoryBrowse enabled="false" />
</system.webServer>
</configuration>
一般,虚拟主机商都没有在主机管理里提供屏蔽IP访问的功能,当然,如果有你就方便很多。其实,即使虚拟主机商没有提供屏蔽指定IP访问的功能,我们也可以很简单地实现它。方法很简单:在htaccess文件中加入屏蔽IP的字段。
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)