0
想example.com重定向到www.example.com和example.de到www.example.de中重定向非www到www與RewriteRules.config
<rule name="CanonicalHostNameRuleCOM" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" negate="false" pattern="^example\.com$" />
</conditions>
<action type="Redirect" url="http://www.example.com/{R:1}" redirectType="Permanent" />
</rule>
<rule name="CanonicalHostNameRuleDE" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" negate="false" pattern="^example\.de$" />
</conditions>
<action type="Redirect" url="http://www.example.de/{R:1}" redirectType="Permanent" />
</rule>