Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
What is duplicate content and how can I avoid being penalized for it on my site?

I have both the .com and the .org for a domain name, and using Apache I point them to the same site content. I think this might be causing problems with the Search Engines because of duplicate content. I want the .org to be the essential website. How do others handle this situation?

Should I be using 301 redirects to point all the .com requests to the .org?

Should I just use the link rel="canonical" on each page to point to the .org?

share|improve this question

marked as duplicate by danlefree Oct 14 '12 at 22:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 6 down vote accepted

Yes, you should use a 301 permanent Redirect from .com to .org else google will mark one of the domain for duplicate content and that is not somwthing you want.

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.org The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.org/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Hope that helps.

share|improve this answer
It works. Thank you. – bunzip Jun 29 '11 at 18:31

I expanded on the excellent answer by @Pheonix.

I am using Apache with virtualhosts, so this specifically applies to that.

I had four variations of URLs - www.thisdomain.com, thisdomain.com, www.thisdomain.org and thisdomain.org. I selected thisdomain.org as the definitive one. I split the virtualhost entry in Apache so I had one directory for the com and one for the org. I left all the PHP code alone in the org, and had an empty directory for the com. In the com directory I created a .htaccess file like @Pheonix suggested. I expanded it a little so that www.thisdomain.com and thisdomain.com would be redirected to thisdomain.org.

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{http_host} ^thisdomain.com [NC]
RewriteRule ^(.*)$ http://thisdomain.org/$1 [R=301,NC,L]
RewriteCond %{http_host} ^www.thisdomain.com [NC]
RewriteRule ^(.*)$ http://thisdomain.org/$1 [R=301,NC,L]

I could probably simply this by using [OR] and combining the two RewriteCond conditions and having only one RewriteRule.

Then in the directory for the org, I added another .htaccess file like this:

RewriteEngine On
RewriteCond %{http_host} ^www.thisdomain.org [NC]
RewriteRule ^(.*)$ http://thisdomain.org/$1 [R=301,NC,L]`

This redirects www.thisdomain.org to thisdomain.org. And now all four URL variations go to thisdomain.org and there is no duplicate content.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.