I have 2 domains, for example KeywordKeyword.com and keyword-keyword.com. I have keyword-keyword.com forwarded via my hosting account to KeywordKeyword.com. I have just noticed that Google is indexing both domains and the content that is on KeywordKeyword.com is also being indexed under the hyphenated domain. How do I properly ensure the following: 1) Have the hyphenated domain redirect to KeywordKeyword.com properly. I am assuming something to do with the .htaccess file but I am not sure what? 2) Ensure that the pages indexed in the SERPS for the hyphenated domain are 301'd to the KeywordKeyword.com domain so that domain is credited with the content rather then both? I am hoping someone can post the simple solution to get this done.
If I were to do this I would park the second domain on the first. I'm not sure on how exactly this would effect things SEO-wise. Another solution might be to use php to redirect all URLs on 2nd domain to the 1st one with a 301.
Thanks for the response Sepehr Although my main concern is to resolve the SEO issues, which in this case is the duplicate indexing. I want the second domain to re-direct ALL traffic to the first domain. I understand using 301 redirects also flow page rank, etc. The only issue is I do not know how to complete the task. Suggestions?
You will need to use modrewrite in your .htaccess file to achieve this. Sample code: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?keyword-keyword.com [NC] RewriteRule ^(.*)$ http://www.KeywordKeyword.com/$1 [L,R=301] Code (markup): What this does is says anything that comes in on either www.keyword-keyword.com or keyword-keyword.com will be redirected to www.KeywordKeyword.com Anything that is located after the trailing slash will be appended. So if someone came in on: keyword-keyword.com/i-love-google.html they would end up at: www.KeywordKeyword.com/i-love-google.html The header would be set as a 301 so all juice, etc would be passed from one page to the next.
I thank you MartinPrestovic. This was exactly what I needed to sort out the issue. Now just need to wait for the SEs to update.