Monday 18 February 2013

301 Redirection from Multiple Domains

If you have domains: domain1.com, domain2.com and domain3.com and you want to do 301 redirection.
In this case, first:
  1. Just host the domain1.com into the server.
  2. Park the domain2.com and domain3.com under the domain1.com hosting account. 
  3. Then, create a .htaccess file on the domain1.com /public_html folder in the server. 
  4. And, the following code into the .htaccess file which is for making 301 redirection (page to page redirection) to domain1.com.
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.domain1\.co\.uk
RewriteRule (.*) http://www.domain1.co.uk/$1 [R=301,L]

No comments:

Post a Comment

Please post any queries and comments here.