Hi.
I am using Global redirect module and option "Generate canonical urls". It is working perfect, but there is one problem.
If we have a few pages, for example:
http://site.com/chairs/gold
http://site.com/chairs/gold?page=1
http://site.com/chairs/gold?page=2
http://site.com/chairs/gold?page=3
then canonical urls for these pages will be:
http://site.com/chairs/gold
http://site.com/chairs/gold?page=1
http://site.com/chairs/gold?page=2
http://site.com/chairs/gold?page=3
but they MUST be:
http://site.com/chairs/gold
http://site.com/chairs/gold
http://site.com/chairs/gold
http://site.com/chairs/gold
How to fix it?
Comment | File | Size | Author |
---|---|---|---|
#8 | globalredirect-canonical-query-exclude-1805904-5.patch | 3.18 KB | markpavlitski |
Comments
Comment #1
WeRockYourWeb.com CreditAttribution: WeRockYourWeb.com commentedAre you sure that's a good idea? Discussion: http://www.seroundtable.com/seo-canonical-pagination-13094.html
Comment #2
ACD CreditAttribution: ACD commentedYeah, 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.
Comment #3
ACD CreditAttribution: ACD commentedYeah, 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.
Comment #4
szy CreditAttribution: szy commentedIt 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.
Comment #5
markpavlitski CreditAttribution: markpavlitski commentedThe 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".
Comment #6
markpavlitski CreditAttribution: markpavlitski commentedComment #7
markpavlitski CreditAttribution: markpavlitski commentedComment #8
markpavlitski CreditAttribution: markpavlitski commented...oops forgot to attach the patch...
Comment #9
Mantalo Conseil CreditAttribution: Mantalo Conseil commentedThanks 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']);