1

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.

anubhava
  • 664,788
  • 59
  • 469
  • 547
LGVentura
  • 1,499
  • 1
  • 11
  • 17

1 Answers1

0

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]
anubhava
  • 664,788
  • 59
  • 469
  • 547