Dreamry.com
Internet Marketing and Promotion
Webmaster Tools, Tips, Techniques and Resources

Links                           Site Map                           Blog

Content Editing
Get a high quality, and reader-friendly, website that your customers will want to visit again and again




Copy Editing
Every website must convey clear and concise information that is relevant to it's customers




Proof Reading
Avoid poor grammar, spelling mistakes, lack of style consistency and typographical errors




Marketing Resources
One hundred free articles, like the ones listed above, to help you succeed on the internet



How to Prevent Duplicate Content
by Harvey Kane

Duplicate content is a problem with many websites and most webmasters don't realize they are doing anything wrong. Most search engines want to provide relevant results for their users, it's how Google got successful. If the search engine was to return 5 identical pages on the same page of the search results, it's not likely to be useful to the searcher.

Many search engines have filters in place to remove the duplicate listings - this keeps their search results clean and is overall a good feature. From a webmaster's point of view, however, you don't know which copy of the content the search engine is hiding and it can put a real damper on your marketing efforts if the search engines won't show the copy you are trying to promote.

You may think you don't have any duplicate pages on your site... think again. Duplicate content occurs when the search engine finds identical content at different URLs. Consider the following scenarios:


www vs Non-www

http://www.domain.com and http://domain.com

in most cases these will return the same page. In other words, a duplicate of your entire site.


Root vs Index

http://www.domain.com (root) and http://www.domain.com/index.html

Most people's homepages are available by typing either URL - duplicate content.


Session IDs - The Root of All Evil

http://www.domain.com/page.php?PHPSESSID=24FD6437ACE578FEA5745

This problem effects many dynamic sites, including PHP, ASP and Cold Fusion sites. Many forums are poorly indexed because of this as well. Session IDs change every time a visitor comes to your site. In other words, every time the search engine indexes your site, it gets the same content with a different URL. Amazingly, most search engines aren't clever enough to detect this and fix it, so it's up to you as a webmaster.


One Page, Multiple URLs

http://www.domain.com/product.php?category=furniture&product=chair

and

http://www.domain.com/product.php?category=outdoor&product=chair

A product may be allocated to more than one category - in this case the 'product detail' page is identical but it's available via two URLs.


Removing Duplicate Content

Having duplicate content on your site can make marketing significantly more difficult, especially when you are marketing the non-www version and Google is only showing the www version. Because you can't tell the search engines which is the original copy, you must prevent any duplicate content from occuring on your site.

Here are some tips to make this process easier.

1. Non-www vs www

I prefer to use the www version of my domain (no particular reason, it seems to look better on paper). If you are using Apache as your web server, you can include the following lines in your .htaccess file (change the values to your own of course).

RewriteCond %{HTTP_HOST} ^domain.com

RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

If your webhost does not let you edit the .htaccess file, I would consider finding a new host. When it comes to removing duplicate content and producing search engine friendly URLs, Apache's .htaccess is too good to ignore. If your website is hosted on Microsoft IIS, I recommend ISAPI Rewrite instead.

2. Remove All References to 'index.html'

Your homepage should never be referred to as index.html, index.php, index.asp etc. When you build incoming links, you will always get links to www.domain.com - your internal links should always be the same. One of my sites had a different pagerank on "/" (root) and "index.php" because the internal links were pointing to index.php and creating duplicate content. Why go to the trouble of promoting two different pages at half-strength when you can promote a single URL at full-strength?

After you have removed all references to index.html you should set up a 301 redirect (below) to redirect index.html to / (root).

3. Remove Session IDs.

I can give advice for PHP users, ASP and CF users should do their own research on exactly how to remove these. With PHP, if the user does not support cookies, the Session ID is automatically inserted into the URL as a way of maintaining state between pages. Most search engines don't support cookies which means they get a different PHPSESSID in the URL every time they visit - this leads to very ugly indexing.

There is no ideal solution to this so I have to compromise. When sessions are a requirement for the website, I would rather lose a small number of visitors who don't have cookies than put up with PHPSESSID in my search engine listings (and potentially lose a lot more visitors).

To disable PHPSESSID in the URL, you should insert the following code into .htaccess

php_value session.use_only_cookies 1

php_value session.use_trans_sid 0

This will mean visitors with cookies turned off won't be able to use any features of your site that use sessions, e.g. logging in, remembering form data, etc.

4. Ensure All Database-Generated Pages Have Unique URLs.

This is somewhat more complicated, depending how your site is set-up. When I design pages, I'm always wary of the 'one page, one url' rule, and I design my page structure accordingly. If a product belongs to two categories, I ensure that both categories link to the same URL or modify the content significantly on both versions of the page so it's not identical in the eyes of the search engine.

301 Redirects

A 301 redirect is the correct way of telling the search engines that a page has moved permanently. When you still want the non-www domain name to work, you should 301 redirect the visitor to the www domain. The visitor will see the address change and search engines will know to ignore the non-www and use the www instead.

Use your .htaccess to 301 redirect visitors from 'index.html' to '/' and any other pages that get renamed.

redirect 301 /index.html http://www.domain.com/


Summary

While your site will work fine with duplicate content, it definitely spreads your efforts and may cost you in ways that you don't understand. In order to maximize PageRank, and the effectiveness of link campaigns, you should ensure there is no duplicate content on your site.


About the Author

Harvey Kane is a PHP web developer based in Auckland, New Zealand. You are free to distribute this article so long as this credit and all links remain intact.


Return to Index







Copyright © 2007   Dreamry, Inc.