1

I have installed Sitecore 9.1.1 locally with the domain as "sc911" and in this instance I have installed the client's multisites (using a script that installs the packages), built using SXA. Now I created an httpRequestBegin pipeline and put the patch file in the /include folder.

Now when I try to access the site using https://sc911 then my processor method gets hit on the debugger attached, but out of multisite I have one site with the domain as "local.cm.mywebsite.com" and it works fine (means pages are working) but it is not hitting the processor method that I override.

One thing I noticed that when hit https://local.cm.mywebsite.com/sitecore then my processor method gets hit on the debugger attached.

Do you have any idea why is this weird behavior, or I am missing any configuration?

I want my processor to be executed for the https://local.cm.mywebsite.com url and the other pages built under this website.

EDIT: Below is the screenshot of the code snippet for the processor that I have created, this has some logic like it checks the url and on the basis of the url it redirects to some other url on the basis of few checks.

enter image description here

FYI: This processor gets hit on the debugger when I request any page inside the /sitecore url (e.g. https://local.cm.mywebsite.com/sitecore/admin/.......) but when I request a page in the site (e.g. https://local.cm.mywebsite.com/my-site-pages) then the debugger is not getting hit.

Below is the configuration:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <pipelines>
            <httpRequestBegin>
                <processor patch:after="*[@type='Sitecore.Pipelines.HttpRequest.SiteResolver, Sitecore.Kernel']" type="aaa.Web.Foundation.Pipelines.Pipelines.HttpRequestBegin.RedirectProcessor, aaa.Web.Foundation.Pipelines" />
            </httpRequestBegin>
        </pipelines>
    </sitecore>
</configuration>

NOTE: I have checked the namespace and assembly name, it is all correct in the config therefore debugger is getting hit for the /Sitecore/...... urls.

7
  • What do you mean by "I have installed the client's multisites"? Jan 6, 2021 at 14:01
  • What have you overwritten? How is it configured?
    – Gatogordo
    Jan 6, 2021 at 14:06
  • Mark Cassidy, I mean I have installed the packages that has tenant structure for the websites in SXA Jan 6, 2021 at 15:12
  • @Gatogordo, I have edited the question to provide more info. Jan 7, 2021 at 16:56
  • Your config is weird.. SXA removes the processor you are referring and uses "Sitecore.XA.Foundation.Multisite.Pipelines.HttpRequest.SiteResolver" instead. Check your /admin/showconfig.aspx to see if your processor is where it should be.
    – Gatogordo
    Jan 7, 2021 at 17:12

1 Answer 1

1

If you have SXA installed, this will remove the default SiteResolver from the configuration so your config patch will not be working correctly.

Try to patch like this:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <pipelines>
            <httpRequestBegin>
                <processor patch:after="*[@type='Sitecore.XA.Foundation.Multisite.Pipelines.HttpRequest.SiteResolver, Sitecore.XA.Foundation.Multisite']" type="aaa.Web.Foundation.Pipelines.Pipelines.HttpRequestBegin.RedirectProcessor, aaa.Web.Foundation.Pipelines" />
            </httpRequestBegin>
        </pipelines>
    </sitecore>
</configuration>

This should put your resolver just after the SiteResolver from SXA. Verify with /sitecore/admin/showconfig.aspx to make sure your configuration is correct.

A resolver at that place in the pipeline should be executed, also on SXA sites.

Your Answer

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

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