Creating Site Specific Pipelines for Multi-Site Implementation in Sitecore

tl;dr Use the Sitecore Configuration Factory to pass parameters to enable Pipelines to only run for specific sites

I’ve been working on a few multi-site Sitecore implementations lately and the majority of the time most brands within the same company umbrella all want similar functionality, which is very nice and easy for us developers. But as you start to work on larger implementations with different brands it will be inevitable that they all have slightly different requirements.

Pipelines provide us a great way to customize Sitecore, but they run for all requests unless we put in some hacky code:

public override void Process(HttpRequestArgs args)
{
    if (!Sitecore.Context.Site.Name.Equals("mysite1") || !Sitecore.Context.Site.Name.Equals("mysite2"))
        return;

    // run your site specific code
}

Read More