0

我正在使用 IIS 和 HELICON ISAPI 重写。

我的要求: 将 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]

重定向失败。

请帮我。

4

1 回答 1

0

请试试:

RewriteCond %{HTTP_HOST} ^(www\.)?example.com [NC]    
RewriteRule ^/?(anz.*)$ https\://www.example2.com/$1 [L,R=302]
于 2016-12-26T14:09:47.273 回答