Version 1 of the Advanced Site Provider for Sitecore is now released on GitHub. It enables the usage of separate sites, initially limited to sub-domains, with no configuration nor any special content items!

Per the Configuring Multiple Sites article on the Sitecore Developer Network, a single Sitecore instance out of the box is multi-tenant capable and able to render multiple sites with multiple host names. However, it requires adding new sites into the sitecore/sites section of the web.config file. This causes an IIS app pool recycle, which can require extra planning in a production environment where high availability is a necessity.

The documentation recommends the free Multiple Sites Manager module found in the Marketplace (formerly the Shared Source Library). I’ve personally used this module numerous times and my friends, former colleague and Sitecore MVP Niket Ashesh and Jimmie Overby have done a terrific job with the module and keeping it updated across Sitecore versions.

Another option is the excellent and also free Dynamic Sites Manager module, also in the Marketplace, written by Pete Navarra.

However, just prior to the release of the Sitecore Experience Accelerator, I found myself wanting to host multiple sites in my dev/demo/test environments and wanted to reduce the configuration steps required. So I created the Advanced Site Provider and finally cleaned it up enough to release it on GitHub.

Version 1 allows me to host as many sub-domains as I like, easily. As I work on Sitecore modules, I want to test them across numerous versions of Sitecore. With the help of the free Sitecore Instance Manager, this is extremely easy. Here’s my latest pattern:

http://sc71rev140905.localhost – primary host name. Based on template type, the following sub-domains are automatically used:

  • http://sharedsource.sc71rev140905.localhost
  • http://SharedSourceWebForms.sc71rev140905.localhost

As part of other modules I have in the works, I am also deploying numerous demo sites such as http://demosite1.sc71rev140905.localhost.

Currently, two additional steps are necessary to make this work:

  1. In IIS, add an additional wildcard binding: *.sc71rev140905.localhost
  2. For local dev, until Windows supports wildcards in the HOSTS file, you have to add entries for each domain and subdomain. I submitted this as a feature request for Windows 10 but it didn’t make the cut — I’ll post a new request whenever Microsoft opens up the next round of feature requests.

In Version 2, I plan to create a custom Sitecore Template allowing entry of the entire host name, enabling you to use whatever you like: http://demo1.localhost or http://myfavoritesite.localhost.

If you decide to use the Sitecore Experience Accelerator, multi-site support is actually built right in. You can find the documentation for creating a new site using SXA here: Create a tenant and a site.

If you want the nuts and bolts of the implementation: it’s a testament to the extensibility of the Sitecore Experience Platform. Simply implement the SiteProvider interface and programmatically create the Site instead of using the web.config file. Feel free to dive into the code on GitHub.

Have feature requests, questions or thoughts? Feel free to contact me any time.