What is the use of <site patch:before="site[@name='scheduler']" instead of <site patch:before="site[@name='website']"


When Sitecore resolves the site for any request it checks every site definition in top-bottom order.

By default Sitecore contains website and scheduler sites.

website site contains empty hostName and rootPath="/sitecore/content" startItem="/home" attributes. Which means that if none of the sites before matches the request, Sitecore will resolve website as the current site:

<site name="website" rootPath="/sitecore/content" startItem="/home"... />
<site name="scheduler" enableTracking="false" domain="sitecore"/>

If you patch your custom site before website:

<site patch:before="site[@name='website']"

Sitecore will try to resolve it first.

If you patch your custom site before scheduler:

<site patch:before="site[@name='scheduler']" 

it will end up after website and before scheduler so Sitecore will first try to match the request to website and if you don't change default settings for website site, it will always match website site instead of your custom site.

| improve this answer | |
  • Thanks a lot for your answer. – arun tiwari Jul 22 '19 at 6:54

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.