Reputation: 733
my first domain (www.domain-a.com) redirects to the root folder of the server and opens my website. Now I want the second domain (www.domain-b.com) to redirect to www.domain-a.com/site2.htm. Is there a way I can do that with htaccess, without using php? thanks a lot!
Upvotes: 2
Views: 7446
Reputation: 101
Write in your .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain-b.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain-b.com$
RewriteRule (.*)$ http://www.domain-a.com/$1 [R=301,L]
More about it: http://www.orderofbusiness.net/blog/redirect-old-domain-to-new-domain-via-htaccess/
Upvotes: 3