Avoid Duplicate Content – URL Redirect and “Preferred Domain” with Google

by Suzanne on June 13, 2008

 Avoid Duplicate Content – URL Redirect and “Preferred Domain” with Google

I recently ran into a problem where one of my sites was being picked up by Google as two different sites … http://mydomain.com and http://www.mydomain.com.

The reason this is a problem is that you don’t want Google to see this as two different sites and penalize you for duplicate content.

So the best way to handle this is to go in to your Google Webmaster Tools (https://www.google.com/webmasters/tools/dashboard). If you don’t have this set up yet you really need to get set up with Google Webmaster Tools. Once there, find your website and click on your site. Once you get to the dashboard page for that site you will click on the “Tools” which is on the far left at the bottom. From there you will click on the “Set preferred domain” link. I chose the option for adding the “www” as my preferred domain. 

Google Webmaster Tools

Then you will need to go into your .htaccess file and make a modification. If you don’t know how to access this file you will need to talk to customer service with your hosing company.

Once you have access to that file you will need to add this code to it:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php?\ HTTP/ [NC] 
RewriteRule ^(.*)index.php?$ http://www.yourdomain.com/$1 [R=301,L] 
 
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC] 
RewriteRule (.*) http://www.yourdomain.com/$1 [L,R=301] 

Of course you will put your own domain name where the “yourdomain.com” is.

Now when you type your domain in without the “www” it should automatically redirect you to the “www” version and this should solve the confusion with Google and they will know the two are actually the same site.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

{ 4 comments… read them below or add one }

ecolits February 28, 2009 at 10:21 pm

How Cool stuff – cheapest car insurance for 18 yr. old nonowner policy .compare cheap car insurance online provo image as kennewick car insurance quotes cheapest car insurance roseville ,look quotes for car insurance
above so home and car insurance This website has information on see rental car insurance covered by providian credit card .you are entering into a cheapest cost for car insurance alberta car insurance quote .

Reply

CarcassGreen July 19, 2009 at 5:06 am

I guess this is going to become less actual because of the world financial depression, what do you think?

Reply

Kaitlyn Mer August 26, 2009 at 12:57 am

Google it is too exacting. It should be more loyal to users.

Reply

Insurance Zane January 28, 2010 at 3:09 pm

Duplication of content is a problem in my site I have faced it. The Google does not trust new sites. =[
.-= Insurance Zane´s last blog ..Basic Insurance Car Covers =-.

Reply

Leave a Comment

CommentLuv badge

Previous post:

Next post: