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 publically accessible documentation 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, this can cause the need for extra planning in a production environment where high availability is a necessity.
Per the documentation, it recommends the free Multiple Sites Manager module (even though the documentation points to the now retired 404 returning old trac.sitecore.net link,) found in the Marketplace (formerly the Shared Source Library). I personally have used this module numerous times and my friend, former colleague and Sitecore MVP Niket Ashesh and Jimmie Overby have done a terrific job with the module and keeping it updated for the various versions of Sitecore.
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 awesome Sitecore Experience Accelerator, I found myself wanting to host multiple sites in my dev/demo/test environments. I wanted to reduce the amount of steps it took to configure and enable easy multi-tenant capabilities, so I created the Advanced Site Provider. I finally cleaned it up enough to release it on GitHub.
Version 1 meets my current needs and allows me to host as many sub-domains as I would like, easily. As I work on my Sitecore modules, I want to test them across numerous versions of Sitecore. With the help of the Sitecore Instance Manager, also free on the MarketPlace, this is extremely easy. Here is my latest pattern:
http: //sc71rev140905.localhost – primary host name and simply based on template type, the following sub-domains are automatically used:
As part of some of the other modules that I have in the works (more details to be released soon), I am also deploying numerous other demo sites as well, such as:
Currently, there are still two additional steps that are necessary to make this work:
In IIS, you must add an additional wildcard binding:
And for local dev, until Windows supports wildcards in the HOSTS file, you have to add entries for each domain and subdomain. Help me promote this as a feature within the next versions of Windows! I submitted it for Windows 10, but alas, it didn’t make the cut. You can find more details on my blog post from back in 2014 – here. I will post a new one, whenever Microsoft opens up feature requests for the next version!
In Version 2, I will go ahead and create a custom Sitecore Template and allow for the entry of the entire host name, and thereby allowing you to use whatever you like:
http://demo1.localhost or http://myfavoritesite.localhost
If you make the decision to utilize the awesome new Sitecore Experience Accelerator mentioned earlier, it actually has this built in! You can find the documentation for creating a new site using the Experience Accelerator here: https://doc.sitecore.net/sitecore_experience_accelerator/setting_up_and_configuring/configuring/create_a_tenant_and_a_site
Since I know some will choose not to use it, although I strongly suggest you give it serious consideration, I will proceed with Version 2 of this module in the near future.
If you want the nuts and bolts of how it is implemented, it is simple 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 even into the code on Github.
Have any other feature requests, questions or thoughts?
Feel free to contact me, any time.