0

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?

  • I think your problem relies in setting physicalFolder="/fr" for fr. Just change it to physicalFolder="/" and you should be good. Take a look here sdn.sitecore.net/SDN5/Articles/Administration/… – Peter Procházka Apr 25 '18 at 20:13
  • Also check this post about inheriting site definitions: sitecoreskills.blogspot.sk/2014/08/…. You don't need to copy site definitions for all your sites over and over again. Just define en-CA and inherit it for others. For others just overwrite what is different like it this case for fr-CA it would be language="fr-CA" virtualFolder="/fr" – Peter Procházka Apr 25 '18 at 20:16
  • We are following the steps mentioned here and it is not working without mentioning the physical folder. sdn.sitecore.net/Articles/Administration/… – Rathan M Apr 25 '18 at 20:23
  • Try to change order of site definitions. Put abcd.ca as first and put second abcd.cafr. – Peter Procházka Apr 26 '18 at 3:29
  • You said it is going to en-US. Can you please also add the site definition of en-US. Please add it as is, i.e, the same order it is in your site definition – Hishaam Namooya Apr 26 '18 at 5:39

Your Answer

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

Browse other questions tagged or ask your own question.