How To Tackle The Duplicate Content Problem

by Gary on September 26, 2007 · 19 comments

in SEO Basics

Google and other search engines can penalise you for having duplicate content on your website. This may be intentional or unintentional on your part. If it is intentional then either you have your reasons or you can get rid of the problem. On the other hand if duplicate content is being generated on your website without your knowledge you can end up paying a big price without your fault.

Duplicate content can be generated due to some problem with the way your CMS generates pages, because of multiple versions of the same content, or when both http:// and http://www are pointing towards the same URL.

For Google, and represent two separate URLs whereas for you and me it could be the same thing. It is so because you can actually have two different websites on the above mentioned URLs (one www and another non-www) — it rarely happens though. When Google finds two URLs seemingly having the same/duplicate content, it indexes the one it considers the most apt. This way it can easily miss the page you actually want it to find.

The duplicate content problem can significantly harm your search engine rankings. Fortunately, canonical redirection can solve this problem of content duplication.

So what is Canonical redirection?

In canonical redirection, among multiple pages supposed to be having similar content you select a canonic page and then redirect all those pages to this one single page. Hence, if someone goes to he or she should be automatically redirected to Similarly, should be redirected to as these two URLs too are considered separate by Google.

How can you achieve canonical redirection?

For most websites running on Apache the easiest solution is altering the .htaccess file. This file generally resides in the root folder of your website directory. Using your FTP program you can check if that file exists (if there is no need then perhaps you don’t have it there) and if does, then download it and alter it because you wouldn’t like to lose the commands already existing in that file. In case you don’t have it, you can easily create it using Notepad or any text editor. In the .htaccess file add the following lines:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^domain\.com

RewriteRule (.*)$1 [R=301,L]

Replace “domain” with your own domain name. This tells the search engine crawlers that the first URL has been permanently moved to the second URL.

In case you don’t want to use your .htaccess file you can always use some PHP commands to orchestrate the same sort of redirection. Here’s how you do it:


if (substr($_SERVER[‘HTTP_HOST’],0,3) != ‘www’) {

header(‘HTTP/1.1 301 Moved Permanently’);

header(‘Location: http://www.’.$_SERVER[‘HTTP_HOST’]




You can insert this code somewhere in your header.php or top.php file.

Share This Post