Sitecore Experience Editor - Multisite Implementation Site Resolving

Image
Sitecore Experience Editor

We ran into an issue with Sitecore Experience Editor with one of our multisite implementations. Any page that belonged to a site when selected from Content Editor and trying to open in Experience Editor would always resolve to the “website” site. We expected that the querystring parameter sc_site should have the site name of the selected site instead of sc_site=”website”.Various validations were performed to make sure site definition for all sites is correct, the order of in which the sites are defined is also correct but nothing wrong was determined. So, what can be the issue?Do you think the value of language attribute in the site definition can be the problem? Below are the site definitions that we used

<site name="canada-french" inherits="sitebase" rootPath="/sitecore/content/sites/canada" startItem="/home" contentStartItem="/home" language="fr-ca"  database="master"  enableTracking="true" scheme="https"  htmlCacheSize="50MB" registryCacheSize="0" viewStateCacheSize="0" renderingParametersCacheSize="10MB" xslCacheSize="25MB" filteredItemsCacheSize="10MB"/><site name="canada-english" inherits="sitebase" rootPath="/sitecore/content/sites/canada" startItem="/home" contentStartItem="/home" language="en-ca"  database="master"  enableTracking="true" scheme="https"  htmlCacheSize="50MB" registryCacheSize="0" viewStateCacheSize="0" renderingParametersCacheSize="10MB" xslCacheSize="25MB" filteredItemsCacheSize="10MB"/><site name="mexico-spanish" inherits="sitebase" rootPath="/sitecore/content/sites/mexico" startItem="/home" contentStartItem="/home" language="es-MX"  database="master"  enableTracking="true" scheme="https"  htmlCacheSize="50MB" registryCacheSize="0" viewStateCacheSize="0" renderingParametersCacheSize="10MB" xslCacheSize="25MB" filteredItemsCacheSize="10MB"/>

They looked so perfect! Surprisingly Mexico and USA sites were resolving correctly as compared to Canada sites in Exp Editor. So, the cause of the Canada sites resolving to sc_site=website was the case sensitivity typo of the language name attribute. After correcting language=”fr-ca” to language=”fr-CA” the Experiene Editor started resolving the site as needed. Really a small thing but it took us couple of days to figure out the issue.