How to do Basecamp-style accounts in Asp.Net Mvc?

前端 未结 3 1487
傲寒
傲寒 2021-02-06 13:30

For an Asp.Net software as a service application, I want to do account based subdomains like Basecamp and the rest of the 37Signals products have. E.g. acme.myapp.com will load

3条回答
  •  [愿得一人]
    2021-02-06 13:40

    Maarten Balliauw's blog covered one method extending RouteBase. I think I've also seen a custom route handler used for this.

    Also, this StackOverflow question covered the same question, using a more simplistic approach.

    I definitely recommend factoring this code out into the routing side rather than embedding the logic to get domain information in your controllers.

提交回复
热议问题