Contributions
Sam's Remove & Prevent duplicate content with the canonical tag
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.
Produces a correctly formatted canonical tag as per your current url (seo or otherwise).
Search engines will modify their index according to the tag, removing any duplicates.
Any ranking spread caused by the duplicates will be consolidated onto the correct page.
Any un=listed query string param's will remain un-effected, barring ensuring a correctly formatted string.
Very simple short code addition
Will also optionally remove any duplicate content issues with ssl pages.
Any instances of the osCsid param will be removed.
Default removed param's are: currency, language, page, sort, ref, affiliate_banner_id & osCsid.
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.
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.
Support thread will be found here. http://forums.oscommerce.com/topic/350604-remove-prevent-duplicate-content-with-the-canonical-tag/
Expand All / Collapse All
Modified regex to allow for url encoded chars within param values.
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.
FULL VERSION
Bug Fix: Added test for empty page array.
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.
FULL VERSION
Modified code to allow removal of params in specific pages. Code & idea by hobbynet
Modified code to allow option of removal of index.php from the uri.
Added partial compatibilty with 'search-engine-frindly-url (still in development)', note issues could arise, ie if a param is set but has no value.
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.
FULL VERSION
Modified code to make adding parameters for removal easier, operation is exactly the same & nothing else is effected..
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.
FULL VERSION
Expanded server support, with many thanks to the code provided by Robert Fisher (FWR Media).
Added contols for xhtml content & ssl duplicated pages.
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.
FULL VERSION
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.
Produces a correctly formatted canonical tag as per your current url (seo or otherwise).
Search engines will modify their index according to the tag, removing any duplicates.
Any ranking spread caused by the duplicates will be consolidated onto the correct page.
Any un=listed query string param's will remain un-effected, barring ensuring a correctly formatted string.
Very simple short code addition
Will also optionally remove any duplicate content issues with ssl pages.
Any instances of the osCsid param will be removed.
Default removed param's are: currency, language, page, sort, ref, affiliate_banner_id & osCsid.
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.
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.
Support thread will be found here. http://forums.oscommerce.com/topic/350604-remove-prevent-duplicate-content-with-the-canonical-tag/
Note: Contributions are used at own risk.