I was having trouble with duplicate content when it came to category and manufacturer pages that get sorted (i.e. same category sorted A-Z or Z-A was getting indexed as two separate pages).
I included the following in my header:
Code: Select all
<?php if ( !empty($_GET['sort']) ) { ?>
<link rel="canonical" href="http://mysite.com<?php echo parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH);?>" />
<?php } ?>
It even works on sub categories, so http://mysite.com/category-url/subcategory-url
I haven't had any trouble with product pages showing up as duplicate content, but this seems to be working for my category and manufacturer pages.