Canonical urls on multi-lingual sites


I am having a problem with canonical urls using the wrong domain on a multi-lingual site, and wondered if anybody had any suggestions.

The CMS is configured with a lot of different domains. Each market has a live domain and an origin domain (for the load balancer). If a market has a single language, then the live domain is set as the primary domain and assigned the language:

Host Name                 Culture   Type   en-GB          en-GB     Primary

Using the canonical url function @Html.CanonicalLink() on the live domain generates correct canonical urls:

href="/mypage" rel="canonical" />

For a market that has multiple languages e.g. Belgium, the live domain is not set with a culture or set to primary. The language is toggled using a dropdown in the website navigation.

Host Name                 Culture   Type         

Using the canonical url function @Html.CanonicalLink() on the live domain for these ones incorrectly generates a url containing the origin:

/nl-be/mypage" rel="canonical" />

I guess this is because there is no primary domain/language set up. In this case EPiServer seems to arbitrarily chose a domain from the list that has no culture set.

Is there anyway I can avoid this problem, or do I need to build my own canonical url function?

Dec 15, 2016 12:34

If I'm reading you correctly I think I have a feature request posted that is being looked at or lying around in the backlog:

Dec 18, 2016 23:48
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.