Support from Acquia helps fund testing for Drupal Acquia logo

Comments

WeRockYourWeb.com’s picture

Are you sure that's a good idea? Discussion: http://www.seroundtable.com/seo-canonical-pagination-13094.html

ACD’s picture

Yeah, I also agree that in @WeRockYourWeb.com's example it's not a good idea to use canonical links for pagination. But, imagine that instead of page numbers in the URL we have filter parameters, order rules or GET request vars for our form. All these pages have almost the same content, and this is the main cause of using canonical links.

So, canonical links don't work in Global Redirect. Metatags module solves this problem. It's almost ok. But on "sub-pages" http:// ... gold?page=1 (2, 3, ..) it shows canonical = "/gold" (relative) instead of full absolute path which is better variant - http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394.

ACD’s picture

Yeah, I also agree that in @WeRockYourWeb.com's example it's not a good idea to use canonical links for pagination. But, imagine that instead of page numbers in the URL we have filter parameters, order rules or GET request vars for our form. All these pages have almost the same content, and this is the main cause of using canonical links.

So, canonical links don't work in Global Redirect. Metatags module solves this problem. It's almost ok. But on "sub-pages" http:// ... gold?page=1 (2, 3, ..) it shows canonical = "/gold" (relative) instead of full absolute path which is better variant - http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394.

szy’s picture

Title: canonical - correct urls » Canonical - correct urls

It causes the serious SEO issue with indexing of big
taxonomies in Google.

Is there a chance to at least have a patch for it?

Szy.

markpavlitski’s picture

Assigned: quip » Unassigned
Status: Active » Needs review

The attached patch provides a new configuration option where you can specify a list of query parameters to exclude.

So in the case of the OP, you would need to set this option to "page".

markpavlitski’s picture

Title: Canonical - correct urls » Omit query parameters when generating canonical urls
markpavlitski’s picture

Category: support » feature
markpavlitski’s picture

...oops forgot to attach the patch...

Mantalo Conseil’s picture

Issue summary: View changes

Thanks for the patch.

To make it works, you had to replace this line :

$query_string = array_diff($query_string, $settings['canonical_query_exclude']);
by
$query_string = array_diff_key($query_string, $settings['canonical_query_exclude']);