<link rel="canonical" href="[[++site_url]][[*id:isnot=`[[++site_start]]`:then=`[[*uri]]`]]">
This works with "Use Friendly Alias Path" and friendly URLs:
<link rel="canonical" href="[[++site_url]][[*id:isnot=`[[++site_start]]`:then=`[[*uri]]`]]">
You can install it and see for yourself. It outputs the full URL of the page, ie.
http://www.somesite.com/gallery.html
<link rel="canonical" href="[[++site_url]][[*id:isnot=`[[++site_start]]`:then=`index.php?id=[[*id]]`]]">
http://site_url/index.php?id-X
So I want to inform the search engines that this is the static link and if the url of the resource has changed (the resource is moved under different parent resource) the canonical url stays the same.
Maybe someone could give me better approach to do this.
The rel="canonical" attribute should be used only to specify the preferred version of many pages with identical content.