This project is read-only.

Multi-tenancy with multiple urls

Dec 26, 2010 at 4:10 AM


Is it possible to bind tenants to multiple urls somehow? I'd like not to create a tenant for each subdomain/domain, as many of them should point to the same site... Eg. and should point to the Tenant_1, but and to Tenant_2. I have about 50 different domains that should point to 10-20 sites (which differ only by content), so the multi-tenancy should be perfect solution for this. For obvious reasons setting up 20 Orchard instances for each (very simple) site is nowhere near the optimal solution...

In IIS7 I could use URL Rewrite to rewrite URLs to match tenant's if only I had some regular pattern in URLs, but... Different domains can point to the same tenant, so there is no regularity (eg., and should point to the same tenant).

If it isn't possible out-of-the-box maybe you can point me what to modify to achieve this? Maybe there is some extension point I could use in custom module to achieve this functionality without modyfing Orchard core (it would be a perfect solution)?

If multi-tenancy is really meant to be a lightweight replacement for heavy IIS multi-site setup - multiple URL binding is a must-have...

- Piotr

Dec 26, 2010 at 8:00 AM

Well, isn't it bad practice with regards to SEO to have multiple URLs for the same content? You could have a permanent redirect for the duplicate URLs to the canonical domain of the tenant it corresponds to.

Dec 26, 2010 at 10:53 PM

Right, it is a bad practice. But I have some old sites which I was told to rewrite - as fast as I can (so the most straightforward solution came to my mind). Could you please help me how to set a permanent redirect in Orchard. Where is the best place to return appropriate 3XX headers? Do I have to write my own module and set those in route table somehow?

- Piotr

Dec 26, 2010 at 11:27 PM

It's not in Orchard that you'd do that, but rather in IIS.

Dec 27, 2010 at 12:48 AM

Ok, thanks, I'll try in IIS.

- Piotr