<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!--<rule name="Add www" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_HOST}" pattern="test.com" />
</conditions>
<action type="Redirect" url="http://www.test.com/{R:0}" />
</rule>-->
<rule name="Add www" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^test.com$" />
</conditions>
<action type="Redirect" url="http://www.test.com/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
相关