Url Rewriting
Posted: Tue Sep 16, 2014 1:55 am
Hi,
I have 2 domains "first.com" and "second.com" (both are pointed to same server).
I hosted a site under "first.com". When I type the url "second.com", the site should redirect to "first.com" but in address bar it should show only "second.com".
I tried the following code in .htaccess file, and its redirecting to first.com but url is also changing as first.com.
RewriteCond %{HTTP_HOST} ^second\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.second\.com$
RewriteRule ^/?$ "http\:\/\/first\.com\/" [R=301,L]
I want to show the url as second.com but redirect to first.com.
Anybody pls help me to achieve this.
I have 2 domains "first.com" and "second.com" (both are pointed to same server).
I hosted a site under "first.com". When I type the url "second.com", the site should redirect to "first.com" but in address bar it should show only "second.com".
I tried the following code in .htaccess file, and its redirecting to first.com but url is also changing as first.com.
RewriteCond %{HTTP_HOST} ^second\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.second\.com$
RewriteRule ^/?$ "http\:\/\/first\.com\/" [R=301,L]
I want to show the url as second.com but redirect to first.com.
Anybody pls help me to achieve this.