6

I am configuring a multiple sites with different languages using virtual folder and physical folder as there is a requirement that specifies to use the same domain to map to different nodes.

These are the site definitions for my sites.

        <site patch:before="site[@name='website']"
        name="TestSite2"
        rootPath="/sitecore/content/fr-BE"
        startItem="/home"
        notFoundItem="/home/Landing Pages/404"            
        loginPage="/loginpage"
        virtualFolder="/fr-BE"
        physicalFolder="/fr-BE"
        requireLogin="false" 
        database="master"
        domain="extranet"
        allowDebug="false"
        cacheHtml="true"
        htmlCacheSize="10MB"
        registryCacheSize="0"
        viewStateCacheSize="0"
        xslCacheSize="5MB"
        filteredItemsCacheSize="2MB"
        language="fr-BE"
        enablePreview="true"
        enableWebEdit="true"
        enableDebugger="false"
        disableClientData="false"
        systemFilesPath="/sitecore/media library/System" 
        robotsTxtItem="/robotstxt File"
        targetHostName="testsite"
        xmlSitemapFilename="sitemap.xml"
        xmlSitemapDisableCompression="true" 
        scheme="http"           
        />


        <site patch:before="site[@name='website']"
        name="TestSite3"
        rootPath="/sitecore/content/nl-BE"
        startItem="/home"
        notFoundItem="/home/Landing Pages/404"           
        loginPage="/loginpage"
        virtualFolder="/nl-BE"
        physicalFolder="/nl-BE"
        requireLogin="false" 
        database="master"
        domain="extranet"
        allowDebug="false"
        cacheHtml="true"
        htmlCacheSize="10MB"
        registryCacheSize="0"
        viewStateCacheSize="0"
        xslCacheSize="5MB"
        filteredItemsCacheSize="2MB"
        language="nl-BE"
        enablePreview="true"
        enableWebEdit="true"
        enableDebugger="false"
        disableClientData="false"
        systemFilesPath="/sitecore/media library/System" 
        robotsTxtItem="/robotstxt File"
        targetHostName="testsite"
        xmlSitemapFilename="sitemap.xml"
        xmlSitemapDisableCompression="true" 
        scheme="http"           
        />

The setting Languages.AlwaysStripLanguage has been patched to false

The issue I am having is that the site context that is being resolved to website when opening http://testsite/fr-be or http://testsite/nl-be.

It is not being resolved to the TestSite2 or TestSite3.

Is this the default behaviour?

I am using sitecore 8.2 Update 1.

  • Try removing <processor type="Sitecore.Pipelines.PreprocessRequest.StripLanguage, Sitecore.Kernel" /> from the <preprocessRequest> pipeline, see if it makes a difference. – Mark Cassidy Mar 1 '18 at 13:57
  • From what I know that's a problem with Sitecore languages in the url. Sitecore ignores the first url segment if there is a language with a code equal to what's in the url. I guess if you would try with anything that is not a language code as your virtual folder it would work. – Marek Musielak Mar 1 '18 at 14:11
  • Can you please check your /sitecore/admin/showconfig.aspx file to see if the above patched site definitions exists there and they are before the "website" site definition ? also check "Language.AlwaysStripLanguage" setting in ShowConfig.aspx also set to "false"... If above options are correctly done, then please check if your "website" site definition have any hostName attribute defined ? if there is no hostName for "website" definition, then please try removing "targetHostName" attribute from your two site definitions and see if it is working. – scFootsteps Mar 1 '18 at 14:17
  • @MarekMusielak I think "Languages.AlwaysStripLanguage" setting set to "false" tells sitecore to ignore language checking as the first part of the url. – scFootsteps Mar 1 '18 at 14:18
  • @MarkCassidy i removed the processor <processor type="Sitecore.Pipelines.PreprocessRequest.StripLanguage, Sitecore.Kernel" /> but it was still resolving the context to website. – adarsh Mar 1 '18 at 15:01
8

Can you please check your /sitecore/admin/showconfig.aspx file to see if the above patched site definitions exists there and they are before the "website" site definition ?

Also check Language.AlwaysStripLanguage setting in ShowConfig.aspx also set to false.

If above options are correctly done, then please check if your "website" site definition have any hostName attribute defined ?

If there is no hostName for "website" definition, then please try removing targetHostName attribute from your two site definitions and see if it is working.

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.