2016-12-24 99 views
0

我正在使用IIS和HELICON ISAPI重寫。使用HELICON ISAPI重寫&ASP.Net MVC - 網址重定向

我的要求: 重定向1市場特定的網站到新的域。

例如:www.example.com/anz - > www.example2.com/anz(應該重定向)
www.example.com/deu - > www.example.com/deu(不應該重定向)

我嘗試:

的RewriteCond%{HTTP_HOST}^example.com [NC]

重寫規則^(。*)$ https://example2.com/ $ 1 [L,R = 302]

它重定向,但兩個市場。

並再次用

的RewriteCond%{HTTP_HOST}^example.com/ANZ [NC]

重寫規則^(。*)$ www.example2.com/anz/$1 [L,R = 302]

未能重定向。

並再次用轉義序列字符

的RewriteCond%{HTTP_HOST}^example.com \/ANZ [NC]

重寫規則^(。*)$ https://example2.com/anz/ $ 1 [L,R = 302]

未能重定向。

請幫幫我。

回答

0

請嘗試:

RewriteCond %{HTTP_HOST} ^(www\.)?example.com [NC]  
RewriteRule ^/?(anz.*)$ https\://www.example2.com/$1 [L,R=302]