Suraj Kumar Goel

Suraj Kumar Goel

Recently i bought new domain for my blog, however i have already an old domain name.


I am very satisfied with my new domain but i was afraid that may be i will lose my visitors because they are not familiar with my new domain.

So the best option is that i have used redirect functionality, where my old domain will be redirected to new one.


Below are the code and it will be applicable for Apache server.

<IfModule mod_rewrite.c>

  RewriteEngine On

  RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]

  RewriteCond %{HTTP_HOST} ^www.olddomain.com$

  RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]