: I have domain.com and domain.org to the same site, should I use redirects to avoid duplicate content Possible Duplicate: What is duplicate content and how can I avoid being penalized for
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?
More posts by @Harper822
2 Comments
Sorted by latest first Latest Oldest Best
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 - thisdomain.com, thisdomain.com, 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 thisdomain.com and thisdomain.com would be redirected to thisdomain.org.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{http_host} ^thisdomain.com [NC]
RewriteRule ^(.*)$ thisdomain.org/ [R=301,NC,L]
RewriteCond %{http_host} ^www.thisdomain.com [NC]
RewriteRule ^(.*)$ thisdomain.org/ [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 ^(.*)$ thisdomain.org/ [R=301,NC,L]`
This redirects thisdomain.org to thisdomain.org. And now all four URL variations go to thisdomain.org and there is no duplicate content.
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 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 ^(.*)$ www.domain.org/ [r=301,nc]
Please REPLACE domain.com and 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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.