I want redirect:
http://cbpq.luisgustavoventura.com/
AND
http://luisgustavoventura.com/cbpq/
to:
http://cbpq.org.br/
i tried:
RewriteCond %{HTTP_HOST} ^(cbpq\.luisgustavoventura\.com|luisgustavoventura\.com/cbpq)$ [NC]
RewriteRule ^(.*) https://www.cbpq.org.br/$1 [L,R]
but doesn't work.
Please, suggest.
You cannot match /cbpq
using %{HTTP_HOST}
variable. It is better to keep these as 2 separate rules:
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]