ASP.NET application for multiple tenants

I have an Asp.net 3.5 application. I want to be able to allow multiple / different clients to access the same application, but use different URLs. I have already managed to configure the database to allow this. So here is the main part. I want to host my application in a domain, say ...

wwww.myapplication.com

then allow another client to access the same application using

1) www.clientOne.myapplication.com
2) www.clientTwo.myapplication.com

  • Also, ie client subdomains (clientone.myapplication.com and clienttwo.myapplication.com) must be auto-registered by the client upon registration.

How can I achieve this ... Your help will be greatly appreciated

A good example of how I want my app to work www.quickschools.com

+6
multi-tenant
source share
4 answers

Hi guys, I finally found the solution I wanted, so I thought I would share my findings with you. Turns out I need to create a web application from another running Asp.net web application (From C # Code)

This Robbe Morris tutorial was really helpful if you need to start with this.

Another article you can check out is this

Thanks for the help.

+4
source share

To have a different URL using the same application, I would use 301 redirect subdomains. I'm not quite sure how to create a web copy of these subdomains.

0
source share

I think the way to do this is to make the site the default website on the server, that is, configure so that all requests for the server’s IP addresses fall on this site (unless the header matches another site that is explicitly looking for it). You do this without specifying a title in IIS settings (only IP address and port number). You can do this for only one host on each IP address / port combination on the server.

Then look at the request URL on the website to determine which domain was requested.

Thus, there is no need to create “subdomains” ... but you need to reject the entire request to a domain that you do not want to recognize.

If you cannot do this, you need to configure the IIS metabase from the application - not impossible - but a very risky and probably bad idea.

0
source share

In general, you will need to set up a new virtual site for each of your new tenants during account creation. See Creating a new virtual server for how to do this programmatically. Some, although claiming (with convincing arguments ...) that deploying an appdomain for each tenant is a waste of resources and you need to use routing in an application that checks the HOST header, see ASP.NET MVC Multi-User - Introduction .

Configuring IIS / ASP to respond to your tenant's sub-dmains is the easy part. The real problem is setting up DNS for your tenants, and it depends on your DNS solution.

0
source share

All Articles