If you are moving your website to a new domain, one of essential steps you need to do is to redirect your old domain to the new one. This is a must do checklist for the sake of your website’s SEO ranking.
Actually there are many ways to do the domain redirection. If you are using WordPress, you can do that by using WordPress redirection plugin. But here’s how to do it by using .htaccess file in your website’s root directory.
Setting up Permanent 301 Redirects
First thing first you need to look up for .htaccess file located in your old website’s root directory. You will need to have FTP access to the directory or ask your hosting provider to provide cPanel access.
Open the .htaccess file and paste following code at the beginning of the file.
RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]
Make sure to replace newsite.com with your new website’s domain.
Once done, save the .htaccess file and try to visit your old website. If everything is fine, it should redirect you to the new website (new domain. If it it not, most likely your hosting does not support redirect rule. You will need to contact your hosting provider about it.