IIS7.5实现web.config的301跳转

Modified on: Sun, 14 Sep 2014 04:11:00 +0800

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WWW Redirect" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^<span style="color: #ff0000;">oiplay.com</span>$" />
</conditions>
<action type="Redirect" url="http://<span style="color: #ff0000;">www.oiplay.com</span>/{R:0}" redirectType="Permanent"/>
</rule>
<rule name="已导入的规则 1" stopProcessing="true">
<match url="^index.php$" ignoreCase="false" />
<action type="None" />
</rule>
<rule name="已导入的规则 2" stopProcessing="true">
<match url="." ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="/index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

评论已关闭