0

When trying to preview an item the resolved site and context does not belong to the correct site chosen in our multisite setup.

Rendering.SiteResolving is true.

Rendering.SiteResolvingMatchCurrentSite is true.

Preview.ResolveSite is true.

sc_site is corectly named as per site config.

If I edit the site configuration so the names doesn't match then I correctly get an error, and reverting gets me a succesfull load but the wrong site have been resolved. So my problem is that my multisite setup does not resolve the correct site when previewing despite the config being setup for it.

I use sitecore 9.1, so many of the older fixes does not apply.(I assume) No related errors are thrown in the log, and I have been unable to figure out how to debug the site resolving process. I could use some pointers in where and how to find the error, so far I've tried to debug from the sitecorecontext to try and catch when the context.Site object gets assigned but no luck. Any help is appreciated.

Edit: This is an example of one of the sites:

<site name="abstract-site-definition"
        virtualFolder="/"
        physicalFolder="/"
        startItem="/FrontPage"
        database="web"
        domain="extranet"
        allowDebug="true"
        cacheHtml="true"
        htmlCacheSize="50MB"
        enablePreview="true"
        enableWebEdit="true"
        enableDebugger="true"
        disableClientData="false"
        formsRoot="{GUID}"
        scheme="https"
        externalPort="80"
        enableItemLanguageFallback="true"
        enableFieldLanguageFallback="true"
        />
<site name="name1" patch:before="site[@name='website']"
            inherits="abstract-site-definition"
            hostName="hostname1"
            targetHostName="hostname1"
            language="se"
            rootPath="/sitecore/content/itemName1/"
      />
  • I assume that the site resolving for the Experience Editor is done in the Sitecore.ExperienceEditor.Pipelines.HttpRequest.ResolveSite, Sitecore.ExperienceEditor class. Are you able to attach to your website process and set a breakpoint in the Process method of this class? – Sebastian Lay Sep 14 at 11:47
  • @SebastianLay I have been trying to debug through Sitecore.Pipelines.HttpRequest.siteResolver but I'm not all variables are obtainable, and haven't to find anything useful. I don't see the class you are refering to. – Benjamin Sep 14 at 13:52
  • Did you explicitly fill out your <HostName> and <TargetHostName> in the site definition of all of your sites? – Marcel Sep 14 at 18:31
  • @Marcel yes I have filled out hostname and targethostname for all the sites. – Benjamin Sep 14 at 19:07
0

I believe the context is set by the users login so if you log in to mysite1/sitecore that will be the context that the Experience Editor works in. You can of course change it using the nav bar but not really what you are looking for

| improve this answer | |

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.