Zach Russell
Zach Russell

Reputation: 1130

Redirect one domain to another in .htaccess

I am looking to one domain to another with all sub-urls as well. The original url would be ehanceinsdev.com and the redirected url would be www.enhanceinsurance.com. I would want it so that enhanceinsdev.com/foo would go to www.enhanceinsurance.com/foo.

Thanks for your help!

Upvotes: 2

Views: 1060

Answers (2)

Panama Jack
Panama Jack

Reputation: 24448

Try

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^ehanceinsdev\.com$ [NC]
RewriteRule ^(.*)$ http://www.enhanceinsurance.com/$1 [R=301,L]

Upvotes: 0

anubhava
anubhava

Reputation: 784938

You can use this simple rule in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^enhanceinsdev\.wpengine\.com$ [NC]
RewriteRule ^ http://www.enhanceinsurance.com%{REQUEST_URI} [R=301,L,NE]

Upvotes: 2

Related Questions