November Happy Hour will be moved to Thursday December 5th.

Canonical urls on multi-lingual sites

Vote:
 

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      

origin-www.mysite.co.uk   en-GB     
www.mysite.co.uk          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      

origin-www.mysite.be        
www.mysite.be         

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?

#173156
Dec 15, 2016 12:34
Vote:
 

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:
http://world.episerver.com/forum/developer-forum/Feature-requests/Thread-Container/2015/11/official-hostname-for-language-on-site-host-name-row/

#173262
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.