How to create subdomain with username using C# and asp.net?

后端 未结 5 1931
暗喜
暗喜 2020-12-05 22:13

When a user registers with my site, they will get a url like this \"http://username.mysite.com\" to access their page/folder. How this is possible using C# and asp.net mvc.<

5条回答
  •  既然无缘
    2020-12-05 22:38

    I was also looking to implementing your scenario and have some links bookmarked. Maybe this will get you on your way until some SO superstar gives another complete sample ;)

    http://blogs.securancy.com/post/ASPNET-MVC-Subdomain-Routing.aspx (link down)

    • Step 1: Custom RouteBase
    • Step 2: Create the Controller
    • Step 3: Register the Routes
    • Step 4: Subdomains on localhost IIS

    At the end of the article, it also references another SO post:

    Is it possible to make an ASP.NET MVC route based on a subdomain?

    It seems like a SO superstar has already answered the question :)

提交回复
热议问题