0

I am not sure the best way to architect my IIS environment and MVC4 applications.

I have my standard marketing site on www.mydomain.com . This is an mvc4 site.

I have created a 2nd mvc4 application that I want users to be able to access via www.theircompanyname.mydomain.com

I dont want to have to hardcode any subdomains as I need this to be as flexible as possible.

Can anyone suggest what I should be doing?

Diver Dan
  • 9,953
  • 22
  • 95
  • 166

1 Answers1

0

You are looking for a multitenant application, varied on the subdomain.

You can simply pull the correct record from a data source of sorts based on the current subdomain.

Also, for ease of routing and building links, I'd recommend building a new RouteBase subclassed type, that once initialized with the route, would have the subdomain and the referenced client Identifier as a route parameter in the RouteData.Values collection.

This article talks about subclassing RouteBase for a subdomain: How to do Basecamp-style accounts in Asp.Net Mvc?

This stackoverflow.com post has a wealth of links regarding multitenancy: What to keep in mind when developing a multi-tenant asp.net MVC application?

Community
  • 1
  • 1
enorl76
  • 2,562
  • 1
  • 25
  • 38