<?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>
<configuration><system.webServer>
<rewrite>
<rules>
<rule name="WWW Redirect" stopProcessing="true">
<match url="^(.*/)*viewnews-([0-9]+).html\?*(.*)$" />
<action type="Redirect" url="{R:1}article-{R:2}-1.html{R:3}"
redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
上面是完整的重写规则,如果你原来用web.config文件了,直接在</rules>前增加:
<rule name="WWW Redirect" stopProcessing="true">
<match url="^(.*/)*viewnews-([0-9]+).html\?*(.*)$" />
<action type="Redirect" url="{R:1}article-{R:2}-1.html{R:3}"
redirectType="Permanent" />
</rule>
即可。
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)