Editing canonical links without a module, contained in $head? I've not been using Drupal for long (&lt; 3 weeks) but have good knowledge of standard PHP, so I really don't know the 'Drupal' way of doing things yet.

What I'm trying to do is edit the canonical tag for a mobile site. The current path is realtive, however I need it to be absolute, and link to the desktop version of the site.

As far as I can tell the current implementation is not using any module to insert the canonical tag.

By looking at the source code of the rendered page the code appears to be contained in the $head variable which is in html.tpl.php as below

&lt;head profile="&lt;?php print $grddl_profile; ?&gt;"&gt;
&lt;?php print $head; ?&gt;
&lt;title&gt;&lt;?php print $variables['field_meta_title']; ?&gt;&lt;/title&gt;


I've come across a couple of pages like this one that mention things like template_process_html, drupal_get_html_head() and hook_html_head_alter() as relevant functions, but in that example the request is to remove the canonical tags, not to edit them.

I wouldn't mind using a module (providing it would allow me to change the link from www.mysite.com... to m.mysite.com...) but I would need to remove the current canonical tags which comes back to my orignial issue of not being able to find where it is.
You need the Meta Tags module.

After you activate it, go to /admin/config/search/metatags/config/global and, under advanced, you can change the default canonical link.

Look at the path patterns used for PathAuto and prefix them with the desired base url.