Websterz Technology Blog

Free tutorials, Tech News, Source codes, Tweaks and Tips.

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 ^(.*)$ https://websterz.info/$1 [L,R=301,NC]

 

That’s all 🙂

Spread the love

Leave a Reply

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