Forum Moderators: phranque
Sorry, but every time I think I mastered mod_rewrite, the beast makes me go back to my misery! So, I will count on you guys to help me out one more time!
Now I am trying to force a redirect to a domain with ".br" at the end, wich stands for my country.
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.mysite\.com\.br [NC]
RewriteRule (.*) [mysite.com.br...] [R,L]
It doesnīt work. By the way, I have the two domains maped to my www root, and they open with no problems each one of them. But this redirect just doesnīt work.
Iīve tried the [R=301,L] also, with no success. I am using the R because I want the userīs adress bar to change, showing the forced domain.
phoenix_fly
Does it do nothing?
Does it redirect to the wrong domain?
Do you get a server error? If so, what does the server error log say?
Do you have other working rules in this .htaccess file?
[added] One more: Did you flush your browser cache as required before testing? [/added]
The better your description, the more likely that you will get a fast answer.
Jim
RewriteRule ^(.*) [mysite.com.br...] [R,L]
and it seems to have worked!
Seems because I am redirected to a 401 error page. I think itīs because, during the beta-tests, Iīve made authentication required. And maybe the redirect from mod_rewrite doesnīt understand that, doesnīt give the chance for the visitor taht typed the .com domain to be prompted for the username and password.
May be that?