The Html.CanonicalLink() HTML helper is, well, helpful. :)
However, it (always?) renders a relative URL.
Although both relative and absolute URLs are supported, according to Google absolute URLs are preferred: https://support.google.com/webmasters/answer/139066?hl=en&rd=1
Especially since we might have multiple domains pointing to the same site, for example if edit mode is accessed through a different domain, or if both http and https is supported, etc.
I tried looking at the internals of CanonicalLink(), but the CanonicalLinkRenderer class is internal, and I couldn't see a simple way of making CanonicalLink() render an absolute URL instead.
Of course we can roll our own helper method (and we have), but it just seems like the better choice would be to use the built-in one in Episerver.
So, in short: any ideas on how to make CanonicalLink() render absolute canonical tags?
I've had this discussion before... hehe. For me it also makes sense to ALWAYS return an absolute URL. It's actually stripped out if the current request's host is matching the primary host defined in the site definitions. Please see my post here about getting an absolute URL, which you can use in your canonical meta element, and also the comment from Henrik. http://dodavinkeln.se/post/how-to-get-the-external-url-to-content