Multi-tenancy with multiple urls

Developer
Dec 26, 2010 at 3:10 AM

Hi!

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. www.example.com and www.example2.com should point to the Tenant_1, but sth.example.com and www.example3.com 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. example.com, test.com and someurl.com 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

Coordinator
Dec 26, 2010 at 7: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.

Developer
Dec 26, 2010 at 9: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

Coordinator
Dec 26, 2010 at 10:27 PM

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

Developer
Dec 26, 2010 at 11:48 PM

Ok, thanks, I'll try in IIS.

- Piotr