Link to home
Start Free TrialLog in
Avatar of Mongoose42

asked on

htaccess redirect https domainA to domainB

Hello, I am trying to redirect domainA to domainB via the following entry in my .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^
RewriteRule ^(.*) [P]

Open in new window

This works quite well as I thought it did but it does not when a person types into the url 
Then the customer is not redirected to

What am I missing here ?
Avatar of btan

Maybe something such as where can be your domainA and is your domainB. The difference is only on the use of "$ [NC]" meaning appended and no case and for [R=301,L], I see that you use [P] for mod_proxy, maybe we can stick with it..

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

ref - flags
Avatar of Mongoose42


Thanks for the suggestion but it is not working.  Whenever you surf to, you are not redirected as if you were to surf to and then being redirected to
Avatar of btan

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial