2017-04-12 30 views
0

我有多個域名指向同一個服務器(example.nl)重寫域特定的語言內容,而無需更改URL - IIS

的example.my網址應指向example.nl/en的內容,而不必在地址欄中顯示此網址。這只是真正需要的主頁(由於谷歌的addwords問題)。

總而言之,example.my應該在地址欄中顯示example.nl/en的同時顯示example.my的內容。

目前的規則給了我一個錯誤。有小費嗎?

<rule name="Redirect .my" stopProcessing="true"> 
    <match url=".*" /> 
    <conditions> 
     <add input="{HTTP_HOST}" pattern="^.*example\.my$" /> 
    </conditions> 
    <action type="Rewrite" url="http://www.example.nl/en/" /> 
</rule> 

回答

0

這似乎這樣的伎倆對我來說:

<rule name="redirect .my to /en" enabled="true" stopProcessing="true"> 
    <match url="(^$)" ignoreCase="true" /> 
    <conditions> 
    <add input="{HTTP_HOST}" pattern="example.my" /> 
    </conditions> 
    <action type="Redirect" url="http://www.example.my/en/{R:1}" appendQueryString="true" /> 
</rule>