On Sitecore 7.2 (MVC) we are in process of introducing en-CA and fr-CA in our multi-site with multi-lingual project. Where we want to leverage the Virtual Folder concept. Like we want https://abcd.com/ to serve en-CA whereas https://abcd.com/fr to server fr-CA. Following are the site settings we introduced:
<site name="execpreview.aff"
virtualFolder="/"
physicalFolder="/"
hostName="pre.abcd.com|pre-stg.abcd.com|pre-dev.abcd.com"
rootPath="/sitecore/content/MySite"
startItem="home"
database="web"
domain="sitecore"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="10MB"
registryCacheSize="0"
viewStateCacheSize="0"
xslCacheSize="5MB"
filteredItemsCacheSize="2MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"
patch:before="site[@name='website']"
enableFallback="false"
dictionaryDomain="MySite Dictionary"
/>
<site name="execpreviewaff.ca"
language="en-CA"
virtualFolder="/"
physicalFolder="/"
hostName="pre-ca.abcd.com|pre-stg-ca.abcd.com|pre-dev-ca.abcd.com"
rootPath="/sitecore/content/MySite"
startItem="home"
database="web"
domain="sitecore"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="10MB"
registryCacheSize="0"
viewStateCacheSize="0"
xslCacheSize="5MB"
filteredItemsCacheSize="2MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"
patch:before="site[@name='website']"
enableFallback="false"
dictionaryDomain="Mysite Dictionary"
/>
<site name="execpreviewaff.cafr"
language="fr-CA"
virtualFolder="/fr"
physicalFolder="/fr"
hostName="pre-ca.abcd.com|pre-stg-ca.abcd.com|pre-dev-ca.abcd.com"
rootPath="/sitecore/content/MySite"
startItem="home"
database="web"
domain="sitecore"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="10MB"
registryCacheSize="0"
viewStateCacheSize="0"
xslCacheSize="5MB"
filteredItemsCacheSize="2MB"
enablePreview="true"
enableWebEdit="true"
enableDebugger="true"
disableClientData="false"
patch:before="site[@name='website']"
enableFallback="false"
dictionaryDomain="Mysite Dictionary"
/>
And this is how we have Language Code Map configured in a patch file:
<LanguageCodeMap type="MyAssembly">
<languages hint="raw:AddLanguageCode">
<com tld="com" iso="en" suffix="com" isdefault="true" />
<uk tld="uk" iso="en-GB" suffix="co.uk" isdefault="false" />
<fr tld="fr" iso="fr-FR" suffix="fr" isdefault="false" />
<de tld="de" iso="de-DE" suffix="de" isdefault="false" />
<mx tld="mx" iso="es-MX" suffix="mx" isdefault="false" />
<au tld="au" iso="en-AU" suffix="com.au" isdefault="false" />
<fr tld="fr" iso="fr-CA" suffix="fr" isdefault="false" />
<ca tld="ca" iso="en-CA" suffix="ca" isdefault="false" />
</languages>
</LanguageCodeMap>
The issue we are facing is https://abcd.com/ is working fine by serving en-CA, but https://abcd/fr is going to en-US site not the fr-CA.
Also if we swap the sequence on these Site Config, en-CA works fine but fr-CA throws a 404. Please note that we already have the Languages.AlwaysStripLanguage=False
. Also if we configure only one at a time, it works fine but breaks when we configure together.
Update 1:
If we change the sequence by adding en-CA first, as I mentioned in the question we get a 404 page for fr-CA with URL as:
https://pre-dev-ca.abcd.com/System/404?item=%2ffr&user=sitecore%5cAnonymous&site=execpreviewaff.ca
Where en-CA works fine. But if we notice the site parameter in the url it is referring to en-CA website not fr-CA.
I strongly suspect there are some mismatch in Site Definitions but unable to locate that.
Can someone please suggest the possible problem?