Redirecting our blog’s domain name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Redirecting our blog’s domain name

    Redirecting our blog’s domain name


    We install our blog under our new domain name but still find many of the links pointing to our old domain, due to which all the visitors get redirected to our old blog until we redirect them to the new one.

    To redirect all our visitors to our new blog we need to add the following code to .htaccess file.

    1) If the old domain is hosted on a separate account, then we need to add following lines in our .htaccess file which should be in in the root directory of our old domain

    RewriteRule ^(.?)$ http://www.ournewdomain.com/$1 [R=301,L]

    2) And if our old domain is parked on our new domain’s hosting account then we need to add following code in our .htaccess file:
    RewriteCond %{HTTP_HOST} !ournewdomain.com$ [NC]
    RewriteRule ^(.*)$ http://www.ournewdomain.com/$1 [L,R=301]


    Thats it...
Working...
X