If you have a website you want to move to a new domain, one of the easiest and best ways to do it is with a 301 redirect in an .htaccess file in your web server root.
301 Redirects are Important
It's important that you use a 301 redirect rather than a meta refresh or other type of redirect. This tells search engines that the pages have been permanently moved to a new location. Google and other search engines will then update their indexes to use the new domain without changing your indexing values. So, if your old website was ranking fairly well in Google, it will continue to rank well after the redirect is indexed. I have personally used 301 redirects for many of the pages on this site with no change in their rankings.
Place all your content on the new domain using the same directory structure and file names as the old domain. This is the most important step. In order for this 301 redirect to work, the domains need to be identical in file structure.
You might also consider putting in a noindex, nofollow robots.txt file on this new domain until you've got the redirect set up. This will insure that Google and other search engines don't index the second domain and penalize you for duplicate content. But if you don't have a lot of content, or can get all the content copied over in a day or so, this isn't as important.
On your old domain website, open up the
.htaccessfile in your root directory with a text editor – if you don't have a file called .htaccess (note the dot at the front), create one. This file may be hidden in your directory list.
Add the line:
redirect 301 / http://www.new domain.com/
to the .htaccess file at the top.
Change the URL
http://www.new domain.com/to the new domain name you're redirecting to.
Save the file to the root of your old website.
Test that the old domain pages now point to the new domain.