If you want to move your website to new domain without hurting its SEO then use 301 redirect. Most simple way to do this is using htaccess mod_rewrite. Here I will explain 2 methods to redirect whole site to new domain.
A wrong way
Most webmaster uses following htaccess rule to move their website but this is a wrong way. This rule redirects each page on old domain to root of new domain (eg: http://olddomain.com/page.html to http://newdomain.com/) that affects indexed pages in search engine. This is not a SEO friendly way so I will not recommend it.
RewriteEngine On RewriteRule ^(.*)$ http://newdomain.com/ [R=301]
SEO friendly way
Another way to redirect is page by page. Following rule redirects each page on old domain to same page on new domain (eg: http://olddomain.com/page.html to http://newdomain.com/page.html).
This is the best way also recommended by Google
RewriteEngine on RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]
How to use?
Simply create a file name .htaccess in root of old website and put above code in that file
To check whether redirect is working properly use our URL redirect checker tool