Preventing Duplicate Content on an E-Commerce Site from Session IDs - The Link Rel Canonical Solution
(Page 4 of 4 )
After many years of duplicate content desperation, Google finally came up with a solution that allows webmasters to specify their preferred (canonical) URLs.
<link rel="canonical" href="http://www.yourwebsite.com/yourpreferredurl.php" />
How does this work? It's very simple. By placing this link rel canonical tag in any of your affected website template files, Google will know the URL you prefer to have indexed without either your or them being forced to deal with an in-depth technical solution.
For example:
http://www.yoursite.com/osc/products_new.php?osCsid=cf66b6d1ecc142348775790bef595556 , is indexed by Google. When Googlebot visits this URL again, and you have done the reconfiguration described in the previous section, it is now confused.
Since http://www.yoursite.com/osc/products_new.php is the canonical URL, we will specify link rel=”canonical” tag in the products_new.php template.
Copy and paste this code to the affected template file:
<link rel="canonical" href="http://www.yoursite.com/osc/products_new.php" />
To do this, download the template file in your desktop to edit it (do not forget to backup!), and then upload it back to your server via FTP.
The link rel=”canonical” tag will be placed in the header section of the template file.
If this is done correctly, it should look like the screen shot below:
Link rel=”canonical” is a highly important solution for the following reasons:
- It will transfer page rank and link juice.
- It will also transfer other URL signals for establishing relevance in the search engines. This ensures that you will not lose any of your earned relevance and you will continue to rank well in search engines.
Conclusion
Duplicate content issues due to session IDs are serious, because they affect rankings in the search engines. All of the corrective actions outlined here are feasible but the most recommended actions include the following:
- Create and use a sitemap containing the canonical list of your preferred URLs that does not use session IDs. An XML sitemap should be uploaded to the root directory and submitted to the Google Webmaster Tools Sitemap section.
- Use “Prevent Spider Sessions” in the Oscommerce admin setup.
- Specify your canonical URLs using the link rel=”canonical” tag in all of your affected website templates.
Using these recommendations, it is assured that when the Googlebot indexes a URL containing a session ID, your server will return the canonical URL. And furthermore, when the Googlebot re-indexes a URL containing a session ID (from the previous crawl in the past), it will know the official URL because of the rel=”canonical” tag, and then update the indexed URL to show your preferred version.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |