Ok here’s the problem:
You have an old website that can be found under olddomain.com and you have a new website that is accessible under newdomain.com.
Copying the content of the old website to the new website is the first step – but what comes after that?
Doing a “301 moved permanently” redirect from the old domain to the new domain – offers several advantages, and it’s not tough to do.
- Users will automatically be redirected to the new domain – you do not have to inform them.
- Search engines will be redirected to the new domain and all related information will be moved to the new domain (but this might take some time).
- Google’s PageRank ™ will be transfered to the new domain, as well as other internal information that is being used to set the position of pages in the search engine result pages (serp’s) – like TrustRank .
So here the solution:
Create a 301 redirect for all http requests that are going to the old domain.
- Example 1 – Redirect from olddomain.com to www.newdomain.com:
RewriteEngine On
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
This is useful when you use www.newdomain.com as your new domain name (see also this article about redirecting www and non-www domains). If not – use the code of example 2.
- Example 2 – Redirect from olddomain.com to newdomain.com:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
See, told you it was easy

