Avoid New link Asset duplication of unique URL


(Josh) #1

Matrix Version:

Hi, creating a New Link asset, in order to mirror one page somewhere else on the site is handy, but how do solve the canonical / non-canonical issue that is created by the 2nd new link asset creating it’s own unique URL?

Both links now have unique URLs and are indexed in search as two separate pages. Is this something that has already been solved by others?


(John gill) #2

Unfortunately not a solved problem. There is no canonical URL functionality to solve the multiple URL problem

Typically I would keep pages to a single link only, and if I wanted to expose a page somewhere else in the IA I would create a page_redirect asset in the second location that points at the real thing.

Obviously there are trade offs there (breadcrumbs etc), but it’s the least-bad solution I’ve found.


(Douglas (@finnatic at @waikato)) #3

There is an active squiz map to add canonical url functionality.


(John gill) #4

Technically active, but also approaching its 6th birthday. It will be an important feature if it lands, but I’m not making plans based on that being soon.


(Bart Banda) #5

You could do things like using a metadata field to choose which URL is the main one, for example using %asset_urls% and then choosing which one you want to print using ^index:0 modifier in the metadata field, then print that as a canonical link in the source code?

Then in your head tag you can print something like this:

<link rel="canonical" href="%frontend_asset_metadata_func.url-canonical^empty:{frontend_asset_urls^index:0}%" />

Which will handle any assets that don’t have that metadata filled out and will use the first URL by default.