Sunday, 22 November 2020

Sitecore pages in Experience editor/Preview mode does not resolve to respective sc_site in Multisite configuration.

 In a Multi site configuration, there are times when we observe sc_site is not resolving to proper website, instead it always default to sc_site=website

This is an existing issue with Sitecore 6/7 and even 8 for which Sitecore provided a patch, please refer Kb article for the patch https://kb.sitecore.net/articles/382913 try installing and making all the suggested configuration changes and the issue should be resolved.

Below is the summary of configuration changes to be done in Sitecore.config to handle the issue and resolving sc_site to respective website name.

Set rendering.SiteResolving = true.

Set Rendering.SiteResolvingMatchCurrentSite = true.

Set Preview.ResolveSite = true.

Although it did not work for me, as my website is multisite with multiple domains configured for few of the websites, for few of our websites we have configured pipe separated multiple Hosts in the sitedefinition.config.

Solution that worked for me

After going through multiple blogs and deep analysis I found that as a best practice suggested by Sitecore we should always have hostName and targetHostName configured for each site's Sitedefinition for any multisite website.

hostName="abc.com|abc2.com|abc3.com"

targetHostName= "abc.com"

So along with Changes suggested by Sitecore in the patch we configured targetHostName and hostName for each of my websites and that worked for me.

Hope that helps...

References:- https://kb.sitecore.net/articles/986056

No comments:

Post a Comment

Related Blogs

Adding Custom CSS classes in Rich text Editor under "Apply CSS Classes" Dropdown.

In My Previous Blog I Tried to show how we can create a Custom Rich Text editor Profile, which is at times required to restrict Content edit...