Currently we have a one Sitecore instance on Sitecore 8.1 with 9 sites hosted using habitat framework. The site definitions are mentioned as follows:

site name="Site1" loginPage="/home"  requireLogin="true" patch:before="site[@name='scheduler']"

site name="Site9" loginPage="/home"  requireLogin="true" patch:before="site[@name='scheduler']"

While opening a page item of site 1 or site 2 in the experience editor, the query string for sc_site is always pointing to site9. Example: sc_lang=en&**sc_site=site9**.

Is this an expected behavior? Or is there any issue in the SiteDefinition.config?

  • Does all the site has the same rootpath and startItem? – Hishaam Namooya Dec 13 '17 at 8:08
  • Can you please check this link. It seems that the patch referenced in this article has been incorporated into the Sitecore 8.1 kb.sitecore.net/articles/382913 Check the below setting in Sitecore.Config: <setting name="Preview.DefaultSite" value="website"/> – Siva Kumar Dec 13 '17 at 8:28
  • Hello Hishaam, the rootpath will site specific /sitecore/content/site1, /sitecore/content/site2 etc. The startItem will be /Home for all the sites. – PVM Dec 13 '17 at 8:46
  • you can set host name for each site in the sitedefinition. login with hostname url to cm environment with which site you want see in Experience editor. – durgar Dec 13 '17 at 12:34
  • You are missing the hostname in you site config. – Chris Auer Dec 13 '17 at 14:28

In the SiteDefinition.config file each site should contain a hostName attribute. Sitecore will match the correct site based on the incoming url and matching hostName.

Check out the SDN page for hostName configuration for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.