locked
Create subdomain programmatically in asp.net C# RRS feed

  • Question

  • User128633903 posted

    Hi every one,

    I want to create subdomain programmaticaly in asp.net with c#.
    My need is when any user get registered with my website then it will be directly redirect to their own private area(i.e, www.username.sitename.com).

    I want to maintain different user session with the same browser (i.e, www.user1.sitename.com is sepertly managed than the www.user2.sitename.com with same browser) so i think URL Rewriting will not going solved this issue.

    some of queries I am having please guide me.

    1) Is it possible to create subdomain programmatically in asp.net C# ?
    2) Dedicated Web server is required for creating subdomains programmatically in asp.net c# ?

    so please guide me for this issue.

    Monday, February 27, 2012 9:35 AM

Answers

  • User560403387 posted

    If you have a wildcard DNS record, and a binding for your website in IIS by IP address (or port. Just not host header), you should have no problem sending requests for all your subdomains to your application.

    Do you need a dedicated web server? Not necessarily, you just need a dedicated ip address.

    At that point, you can get the host name from the request and handle it whichever way you see fit. I imagine url rewriting would work just fine, although I'm not sure which existing modules support this scenario. You might have to write your own.

    Menno

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 27, 2012 10:17 AM

All replies

  • User560403387 posted

    If you have a wildcard DNS record, and a binding for your website in IIS by IP address (or port. Just not host header), you should have no problem sending requests for all your subdomains to your application.

    Do you need a dedicated web server? Not necessarily, you just need a dedicated ip address.

    At that point, you can get the host name from the request and handle it whichever way you see fit. I imagine url rewriting would work just fine, although I'm not sure which existing modules support this scenario. You might have to write your own.

    Menno

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 27, 2012 10:17 AM
  • User128633903 posted

    Hi Menno

    Thanx for your valueable replay :)

    Tuesday, February 28, 2012 1:33 AM