Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Wrong host used for virtual path

Vote:
 

Hi,

I have a multi site setup with 2 sites in the same installation. The first site has 2 different host bindings, www.mydomain.ch and sub.mydomain.ch, both bindings are configured in EPiServer admin and the www domain is the main domain. When visiting the site with the www or sub domains the links are rendered correct (as relative links in the html source so when you click on them you are still on the same domain) but now when I have added another site with two new host bindings, www.mydomain.fi and sub.mydomain.fi, also here with www as the main domain, all links on the site are rendered to sub.mydomain.fi even when I visit the site using the www domain. Have I missed some configuration here?  The links are renderd with the Url.PageUrl, Url.ContentUrl etc.

/Viktor

#113342
Nov 18, 2014 17:02
Vote:
 

Have you added language mappings for all your hosts?

That is: Is both www.mydomain.fi and sub.mydomain.fi mapped to language "fi"?

Also which version are you running on? There was some bugfix done in this area somewhere around CMS.Core7.10 or 7.11 I think it was.

#113367
Nov 19, 2014 12:03
Vote:
 

Hi,

Yes all hosts are connected to a specific langauge (same for all hosts on the same site). I run CMS 7.12 and Commerce 7.11.

/Viktor

#113383
Nov 19, 2014 14:20
Vote:
 

When it determines which host to use for a specific language it will just take the first host matching the langauge in the list. So if you change the order of hosts www.mydomain.fi and sub.mydomain.fi in the host list I think it should work.

Ps.

I know there is no other way to change the order than to remove them and then add them in a specific order. We will look into this and either add sorting or a way to specify hosts (like saying "this host is my main host for this language").

Ds.

#113385
Nov 19, 2014 14:26
Vote:
 

Hi,

Ok, but can't I have two hosts for the same site then without the links being rewritten to one of the hosts? Why does it work for one of the sites but not for the other?

/Viktor

#113386
Nov 19, 2014 14:37
Vote:
 

As it works when a link to a content item is constructed is that it will get all hosts that has a mapping to the language.

If none it will be a relative link (with a language segment if more than one language is enabled)

If there are hosts it will se if the current host is in the list then it will be a relative link (without language segment). If current host is not in list it will take first host in list.

If the link is to another site (in a multi-site scenario) then it will take the first host that matches the language. 

Could it be that for the working site is the www host first in the host list while it is not on the other site?

#113387
Nov 19, 2014 14:45
Vote:
 

Hi,

After a upgrade of the site to version 8.5 for Commerce and 7.18 of EPiServer this issue has been solved.

/Viktor

#114354
Edited, Dec 10, 2014 15:59
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.