2
votes

I want to install multiple Sitecore instances to be hosted under one domain. So the root url of first instance will be http://example.com/instance-1 and so on. The reason I want to have multiple instances is that, I want to split environments for each site. I know I can play with bindings and publish each instance on other port within same domain. I also know that I can install multiple sites under one instance. But I didn't found solution how to install instance in IIS site subdirectory.
Please if anyone was successful instaling multiple instances as child application or virtual directory, please share the knowledge.

I'm using Sitecore 6.5 and IIS 7.5

2

2 Answers

3
votes

Sitecore does not support running in virtual directories. It must run in its own website.

However, i did come up with a trick, but it is quite advanced and i don't have clear cut examples:

  • Setup one site that will be your main domain with sub folders (eg. www.mydomain.com/site-a , www.mydomain.com/site-b
  • Setup your separate Sitecore instances as separate IIS websites
  • Give each site its own hostname and add it to your hosts file (so you get http://site-a, http://site-b, etc)
  • Install the IIS URL Rewrite feature, make sure rewriting of the HTTP_HOST server variable is allowed
  • Configure rewriting on your main site, so that http://www.mydomain.com/site-a/* is rewritten to http://site-a/*
  • Create a custom linkprovider that makes sure Sitecore links are being written using the correct domain and folder (so http://site-a/item is written as http://www.mydomain.com/site-a/item)

I'm sure this is possible as i've implemented a similar solution for a site that hosted clones if a site as 'virtual' folders.

1
votes

I wonder why you have the need to host multiple Sitecore instances on the same domain. Sitecore has good solutions for multi site setup in the same instance. If the solution Ruud provided is not workable for your, check the multi site solution of Tim Ward ( https://github.com/jerrong/Sitecore-Multisite-Manager ) or the shared source module on the Sitecore Marketplace ( http://marketplace.sitecore.net/en/Modules/Multiple_Sites_Manager.aspx )