希望将example.com重定向到www.example.com,将example.de重定向到www.example.de
<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>
答案 0 :(得分:0)
尝试关注.COM&amp; .DE
<强> .COM 强>
<rule name="Redirect to WWW COM" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example.com$" />
</conditions>
<action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent" />
</rule>
<强>由Matchi.com提供回到强>
<rule name="Redirect to WWW DE" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example.de$" />
</conditions>
<action type="Redirect" url="http://www.example.de/{R:0}" redirectType="Permanent" />
</rule>
我希望这会有所帮助