Posted on

.htaccess file – Redirect old domain to new domain

.htaccess file ( most times you can ask your host to do this for you ):
open up your .htaccess file and put the following into it. (OLDDOMAIN is for your previous one and NEWDOMAIN is for your new one)

RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.newdoman.com [NC]
RewriteRule ^(.*)$ http://newdomain.net/$1 [L,R=301,NC]

If you cannot see your .htaccess file, you’ll need to go into your cpanel and change the settings.
http://tinyimg.io/i/KF7ECuR.jpg
http://tinyimg.io/i/JXRF7Sa.jpg

Once done, when someone accesses your old domain, they should be redirected to the new one. 🙂