1

I have two Site groupings set up in Sitecore - Test Auth and Test Prod. Test Auth has a site URL of test1-sc10-auth.com, while Test Prod has a site URL of test1-sc10.com.

auth

prod

However, whenever I click on a search link on the Test Auth site, it appends the Test Prod Targethostname URL at the end of the link, resulting in an incorrect URL structure (for example, https://test1-sc10-auth.comhttps//test1-sc10.com/search-results#e=0&q=news). The only way I have been able to resolve this issue is by unticking the 'Enable Preview' option in both Test Auth and Test Prod.

enter image description here

Can anyone suggest what may be causing this issue and how I can resolve it?

1

3 Answers 3

0

There are several settings in Sitecore.config that help to configure proper site resolving logic. You can check the setting called Rendering.SiteResolvingMatchCurrentSite. To make sure that items are opened in context of correct site, you must set the Rendering.SiteResolvingMatchCurrentSite setting to true that should be checked to true.

Other than that you should also check if the sites are resolving properly in SXA site manager. If not, you should make it resolve.

Here is a good article that you can use to set up multiple hosts for a Sitecore SXA site and verify with your solution if you are missing something.

Setting Up Multiple Hosts For A Sitecore SXA Site

Hope this helps.

0

I would recommend checking Sitecore.XA.SitesToResolveAfterSxa.config configuration. I suspect the issue could be due to Site Resolving.

When SiteContextFactory.GetSiteContext method is called from SxaSiteResolver, a SxaSiteProvider gets resolved in SiteManager and GetSites() method returns all the SXA sites by parsing the items located at /sitecore/content/[Tenant]/[Site]/Settings/Site Grouping/* based on template /sitecore/templates/Foundation/Experience Accelerator/Multisite/Site

If your SXA sites are not resolving correctly, because of compatibility with other modules, you can mark other sites to be resolved before or after SXA sites by adding the site name and resolve="before" or resolve="after" to the Sitecore.XA.SitesToResolveAfterSxa.config (App_Config\Modules\SXA\z.Foundation.Overrides)

Hope it helps!

0

It looks like two Site Groupings are valid for same environment.

To identify this issue you can check SXA Site Manager.

If you have CM and CD servers, it is a good idea to use Valid for Environment field where you could specify your environment variable matching XA.Foundation.Multisite.Environmentsetting like ContentManagement or ContentDelivery.

More details below :

https://doc.sitecore.com/xp/en/developers/sxa/17/sitecore-experience-accelerator/manage-multiple-sites-with-the-sxa-site-manager.html

or

https://www.getfishtank.com/blog/setting-up-multiple-hosts-sitecore-sxa-site

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.