Using an alias on my domain. How do I tell Google that I want it to only index the alias to avoid duplicate content?

I am starting a music blog at www.domain1.com. That URL is an alias shared with www.domain2.com which is just a domain I happen to have hosting with but is unused. In the future I may want to develop a site at www.domain2.com as a portfolio site but for now I have www.domain1.com that I want to use with my hosting.

At first I had www.domain1.com forwarding to www.domain2.com/domain1 and masking that URL so visitors would only ever see www.domain1.com but the URL never changed when people navigated and not having unique URLs is bad for many reasons. I also tried that because it would allow me to be able to develop sites at both domain2.com and /domain1. However, the unique URL thing is an issue. So I ditched that idea and I created an alias. Great! Now I have unique URLs. However now the same content displays at both domain2.com and www.domain1.com. Not great.

My question is how do I tell Google that for the content that is at domain1.com to index that site and don't credit www.domain2.com so I avoid duplicate content issues?

Do I add this to the config file?

RewriteEngine on RewriteRule ^(.*)$ domain1.com$1 [NC,L,R=301] 

Replay

Category: url Time: 2016-07-31 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.244 (s). 12 q(s)