Sam's Remove & Prevent duplicate content with the canonical tag V1.3.2


This script will dynamically read the query string calling the page, remove any parameters that have/may cause duplicate content issues with search engines and generate a canonical tag with the modified query string. The search engines will effectively interpret this as a 301 redirect, there will be no effect on the page or url for your visitors.

If you have an existing install of a meta tag contribution, the install only requires the addition of a single line of code and one added function.


Purpose


If Google etc. can find multiple paths to a single product its likely that the url for that page will vary according to the path taken, that will mean the search engines will consider it a separate page, but as its the same as another with a different url your site will be penalized for having duplicate content.

This situation arises in osC due to paging, sorting, multiple currencies & maybe even multiple languages. Also if you have any links to your site with the osCsid attached you have the same problem & other issues, you should enable Prevent Spider Sessions and update spiders.txt.

This add-on prevents the problem and removes it if it exists by adding a new tag into you page <head> section called a canonical, the search engines see this & will use that in preference to the pages actual url. This removes any parameters from the query string appearing in that link that have been defined as creating the issue.


Version History

Version 1.0

Version 1.1

Version 1.2

Version 1.3

Version 1.3.1

Version 1.3.2

Support, questions - issues - etc


Please post any queries or issues in the support thread found here.

Installation


Please read through all the instructions first & make sure you understand them, if your unsure about anything please read the tips given here.

If you have any errors or problems following your install please also read the tips given here before you rush to post your problem. .


Step 1 - BACKUP

Make backups of all files that may be effected:

    If you don't have any meta tag contributions installed, these will be:

    • All files in your catalog folder.
    • catalog/includes/functions/html_output.php

    If you do have a meta tag contribution installed:

    • Your meta tag include file.
    • catalog/includes/functions/html_output.php

Step 2a - If you don't have any meta tag contributions installed
  • open each file in your catalog folder

Add in the section at the bottom of the meta tags:

<?php CanonicalLink( $xhtml = false, 'SSL' ) ?>


Step 2b - If you do have a meta tag contribution installed
  • open the meta tag file in the catalog/includes folder (ie 'header_tags.php')

Add, at the very bottom, before the last ?>

CanonicalLink( $xhtml = false, 'SSL' );


Step 3 - Add the function

In catalog/includes/functions/html_output.php

Add, at the very bottom, before the last ?>


Step 4 - Saving

Save all changed files and upload to your site.




That's it, your done!


Usage


If you use a xhtml doctype change the $xhtml = false parameter to $xhtml = true, that will mean the closing tag will be /> instead of >.

If you have no 'catalog' pages on a secure server (ie only account etc. pages are there) set the 'SSL' parameter to 'NONSSL', then if anyone has linked any catalog pages as https in error, the search engines will still index as non-ssl, so no duplicate. Account etc. pages will not receive a tag as they should not be index-able, ie blocked by your 'robots.txt'.

If you wish to increase or change the removed param's, edit the line:
$remove_array = array( 'currency','language','main_page','page','sort','ref','affiliate_banner_id','max'); You must ensure you keep to the existing format, ie ,'my tag'

To remove page specific params add to the $page_remove_array, should be in same format as previous, given is manufacturers_id & cPath will be be removed for product_info.php only and no specific removals for index.php.

Its possible the you will get a duplicate content issue with my-domain.com & my-domain.com/index.php as these are one & the same page, you can use .htacces to deal with this:
RewriteCond %{THE_REQUEST} !^POST 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php(.*)\ HTTPS/ [NC]
RewriteRule ^index\.php(.*)$ http:\/\/pivht-supplements.com/$1 [R=301,L]
That is normally sufficient, however on some servers there can still be an issue, if so enable removal of index.php from the uri by setting $rem_index to true in the code.

If you have any errors or problems following your install please also read the tips given here before you rush to post your problem. .



-----

Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.


Note: you will not see anything change on the page, the tag goes in the page head section, so only the search engines see it, you will need to view your pages generated source to see it.


Support thread will be found here.

  

Specialty Products

Show: 

Result Pages: [<< Prev]  ... 16  17  18  19  20 ...  [Next >>]  Displaying 381 to 400 (of 744 products)


Result Pages: [<< Prev]  ... 16  17  18  19  20 ...  [Next >>]  Displaying 381 to 400 (of 744 products)
Quick Find
 
Use keywords to find the product you are looking for.
Advanced Search
Manufacturers
0 items
Currencies
USD
EUR
GBP
CHF
AUD
CAD
CZK
HUF
DKK
JPY
NOK
SEK
UAH
CNY
BGN
SGD
TRY
ZAR
FJD
NPR
NZD
RON
HKD
MXN
ILS
INR
THB
TWD
PHP
MYR
BRL
LVL
LTL

pivht-supplements.com payments methods

Copyright © 2010-2025 pivht-supplements.com Wholesale prices and kits !
Powered by osCommerce