Redirect old domain to new domain with 301

Here are the few lines of code you can add into your .htaccess to redirect your old domain to new domain with 301 (permanent redirect) code.

Open .htaccess file in any editor and add following below lines, please replace websterz.info with your own domain.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^websterz.info [NC,OR]
RewriteCond %{HTTP_HOST} ^www.websterz.info [NC]
RewriteRule ^(.*)$ http://websterz.info/$1 [L,R=301,NC]

 

That’s all 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>