1

我要重定向:

http://cbpq.luisgustavoventura.com/http://luisgustavoventura.com/cbpq/

到:

http://cbpq.org.br/

我试过:

RewriteCond %{HTTP_HOST} ^(cbpq\.luisgustavoventura\.com|luisgustavoventura\.com/cbpq)$ [NC]
RewriteRule ^(.*) https://www.cbpq.org.br/$1 [L,R]

但不起作用。

请,建议。

4

1 回答 1

1

您无法/cbpq使用%{HTTP_HOST}变量进行匹配。最好将它们保留为 2 个单独的规则:

RewriteCond %{HTTP_HOST} ^luisgustavoventura\.com$ [NC]
RewriteRule ^cbpq(/.*)?$ http://www.cbpq.org.br$1 [L,NC,R=302]

RewriteCond %{HTTP_HOST} ^cbpq\.luisgustavoventura\.com$ [NC]
RewriteRule ^(.*)$ http://www.cbpq.org.br/$1 [L,NC,R=302]
于 2015-08-20T04:51:31.753 回答