0

想将 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>
4

1 回答 1

0

尝试关注 .COM 和 .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>

.de

<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>

我希望这会有所帮助

于 2012-11-13T09:58:00.050 回答