My current Sitecore project has a multisite with URL structure as follows

Whenever I do an AJAX call from the subsite landing page the base URL is coming as www.MainSite.com and on inner pages (www.MainSite.com/SubSite/innerpage) of the sub site, the base URL is coming as www.MainSite.com/SubSite in AJAX calls.

I need the base URL to come as www.MainSite.com/SubSite on the landing page as well, so that the AJAX calls will work using one route entry.

When I put an extra slash at the end of the landing page URL (www.MainSite.com/SubSite/), the AJAX call is working.

Any suggestions on how I can resolve this issue?

  • As you said when you use an extra slash in your URL then the Ajax call is working. So did you try adding that extra slash in your ajax call like $.ajax({ url: '/api/sitecore/<ControllerName>/<ActionName>', May 5, 2023 at 12:51
  • if I add like '/api/sitecore/<ControllerName>/ on ajax base url will come www.MainSite.com. but I need subSite as well on the url
    – shahul
    May 9, 2023 at 9:09
  • I think your system is not resolving the site. Did you check this setting? <setting name="Rendering.SiteResolving" value="true"/> May 9, 2023 at 12:22
  • this setting is already there. system is resolving the site only when the url have / after the starting item (home page)
    – shahul
    May 19, 2023 at 11:47


Your Answer

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

Browse other questions tagged or ask your own question.