Multiclient application (multi-tenant) with webforms and routes


I am developing a multi-client web application for a SaaS and I would like each client to have a different URL to access their area in the application, for example:

I thought of creating an application in IIS for each client, but this, in addition to being costly, can degrade the webserver's performance (I believe).

Is there any way to do this using routes?


You need to change your route:

    name: "Default",
    url: "{cliente}/{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }

And retrieve the value in the controller

public ActionResult Index(string cliente)
    return View(cliente);
Scroll to Top