I want to create a multitenant web site where each tenant can create multiple portals similar to what Dotnetnuke does. I want to provide a flexible dynamic routing (that can take effect at run-time e.g. I can add a tenant at run time) like outlined below. I also like to allow/restrict tenants to certain modules (Areas(group of Controllers) for coarse grained access control or Controllers for fine grained access control ) and Controllers Actions for the finest access control.
Tenant doesn't own a domain or subdomain - uses SaaS host domain name)
tenant1.saasplatform.com ( implicitly means has /portal0 suffix ) tenant1.saasplatform.com/portal0 tenant1.saasplatform.com/portal1 saasplatform.com/tenant1 ( implicitly means has /portal0 suffix ) saasplatform.com/tenant1/portal0 saasplatform.com/tenant1/portal1
Tenant owns a domain or subdomain)
tenant1.com ( implicitly means has /portal0 suffix ) tenant1.com/portal0 tenant1.com/portal0 tenant1.com ( implicitly means has portal0. prefix ) portal0.tenant1.com portal1.tenant1.com
Given various combination I want to extract tenantkey based on configuration per tenant. I want also to extract portal number (it can be a unique number for a portal or a unique name).
Everything after portal number will be resolved via normal routing values {controller}/{action}
tenant1.com[/portal0]
"[]" content inside the brackets in optional and it will be treated as "portal0"
{tenantkey}{portal0}
tenant1.saasplatform.com[/portal0]
{tenantkey}.saasplatform.com}{portal0}
{tenantkey}.othersaasplatform.com}{portal0}
[portal0.]tenant1.com
{portalkey}.{tenantkey}
Some good ideas shown below. The article is quite old. I was wondering if there is something new in MVC 3?
http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx