I updated the site from update 22 to 25.
My Visual Studio is configured to run the site on localhost:40351. When I run it then all the URL links to the other site's pages are not rendered with localhost host name but with different host name (mysite.com). The web site configuration in CMS / Admin / Manage Websites is following:
See the screenshots for better understanding: Rendered URL, Site Configuration.
Before the update the behavior was correct, i.e. on localhost all URLs was with localhost host name and on mysite.com all URLs was with mysite.com host name.
BTW why it not possible to insert images directly into the post???...
The idea with host names is to be able to have different hosts for different languages. So it is not recommended to have same language mapped for different hosts (actually it should probably throw an exception when doing so).
With that said, try to change the order of the hosts in the host list in admin mode (yes I know it requires delete and add since there is no sorting functinality in the list....)
I tried this too with the latest version and can not re-produce the issue.
I have following in the site config
And in that order (didn't bother to change the order).
I have a site setup in IIS using the www.sample.dev host and the VS IIS Express uses the localhost address
The host doesn't switch or go wrong on either sites.
I'm using in the code SiteDefinition.Current.StartPage vs Contentreference.StartPage to get the start page but in debugger I see both return the same id for start page so I guess the cause can't be that either.
The star '*' host name do the fix! So with the update 22 the sites works correctly, without the star host name. But with the update 25 you have to provide also the star host name to get the sites working properly. Seems something has changed in EPiServer code.
@Johan: we use the mapping of two sites for one language in the scenario, where developers are running the site on localhost on developer's machines, but testers use the deployed (published) site on the test server. But all sites share the same database.
Glad it sorted out for you. Yes the update contains a bug fix for http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=88163 which caused what you see.
Just for completeness ;) the bug is this one.
Thanks for the answer Antti AlasvuoJust to clarify, the configuration is under CMS>>Admin>>Config>>Manage WebsitesI've added the following Host Name entries in the Website (in that order)Host Name - *Culture - en-GBHost Name - dev.mysite.comCulture - en-GBHost Name - uat.mysite.comCulture - en-GBBoth dev and uat render their native urls correctly.
As an additional info related to '*' host name needed in site settings, I'd like to mention that one of our teams had issues with search autocomplete not returning any results stored with statistics (only those configured with Find optimizations for autocomplete in CMS), and when we have checked site settings '*' was missing.
After adding such host name autocomplete started to work, so it seems that when tracking is used to collect statistics during search and you don't have star '*' host name they are stored with blank site ID (our team received such information from EPiServer support).