I have installed module but I found out that it either creates canonical urls automatically (if you are on https site then canonical url would be https) or you can manually put url inside node edit form but again only url alias, which means that canonical url will be displayed with https if you are on https page.

For seo purposes I need to be sure that content on https does have canonical url pointing to http url. Is there any way to achieve this? Thank you

Comments

DamienMcKenna’s picture

Title: canonical urls https to http protocol » Option to control protocol used on URL fields
Version: 6.x-1.4 » 6.x-1.14
Category: support » feature

There isn't a way of doing this right now without writing custom code, so lets turn it into a feature request.

loparr’s picture

Hi,
I ended up using custom code inside template from this article. Works perfect.
http://robmalon.com/automatic-manual-canonical-url-links-in-drupal/

mr.j’s picture

++ on this.

Somehow one of my client's site has some pages indexed in google under https when they should all be http. This is compounded by the fact that the CDN does not work on https so the page shows up completely nude when the user clicks through from google. When I check the source of the nude pages they all have a canonical URL tag pointing to https which unfortunately is wrong.

This is my temporary sledgehammer fix in page.tpl.php:

// If pages are accessed using https nodewords module is using https in the canonical URL.
$head = str_ireplace('<link rel="canonical" href="https:', '<link rel="canonical" href="http:', $head);
DamienMcKenna’s picture

Version: 6.x-1.14 » 6.x-1.x-dev
Issue summary: View changes