subdomain redirect within application

Discussion in 'ASP .Net' started by Leon, May 6, 2005.

  1. Leon

    Leon Guest

    How do I point a sub-domain to a sub-directory or .aspx page of my site
    using
    asp.net?

    I'm using a shared hosting service, that does not offer subdoman forwarding.
    however, you can write your own asp.net redirect code, and I just want to
    the best way to accomplish this task. it's possible that I may could have a
    1000
    subdomain names to redirect, but within the same application, to the same
    page
    within the aplication that then get some data from the database to format
    the current page.

    I know it is possible for me to forward all subdomain name to my site using
    the wildcard(*),
    but is it possible to send all subdomain to the same .aspx page than get the
    beginning of the
    current subdomain such as ("leon.mydomain.com") leon with then grab some
    leon information
    from the database to format the page?

    I know normally domains are setup to point to the root directory of the web
    site. However, how can I detect which URL a person is browsing to on my site
    with ("such as leon.mydomain.com"), and redirect them to the appropriate
    place on within site ("such as
    mydomain.com/display.aspx?UserId=1&DisplayId=10"),
    and where do I want to put this code in default page of the website or in
    the global.asax
    file.

    Thanks!
    Leon, May 6, 2005
    #1
    1. Advertising

  2. Leon

    Scott Allen Guest

    Hi Leon:

    From your description it sounds as if what you want to do is possible.
    You want to read about a topic known as URL rewriting.

    Here is an article to get you started:
    http://msdn.microsoft.com/asp.net/c...l=/library/en-us/dnaspp/html/urlrewriting.asp

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Fri, 6 May 2005 06:54:51 -0500, "Leon" <> wrote:

    >How do I point a sub-domain to a sub-directory or .aspx page of my site
    >using
    >asp.net?
    >
    >I'm using a shared hosting service, that does not offer subdoman forwarding.
    >however, you can write your own asp.net redirect code, and I just want to
    >the best way to accomplish this task. it's possible that I may could have a
    >1000
    >subdomain names to redirect, but within the same application, to the same
    >page
    >within the aplication that then get some data from the database to format
    >the current page.
    >
    >I know it is possible for me to forward all subdomain name to my site using
    >the wildcard(*),
    >but is it possible to send all subdomain to the same .aspx page than get the
    >beginning of the
    >current subdomain such as ("leon.mydomain.com") leon with then grab some
    >leon information
    >from the database to format the page?
    >
    >I know normally domains are setup to point to the root directory of the web
    >site. However, how can I detect which URL a person is browsing to on my site
    >with ("such as leon.mydomain.com"), and redirect them to the appropriate
    >place on within site ("such as
    >mydomain.com/display.aspx?UserId=1&DisplayId=10"),
    >and where do I want to put this code in default page of the website or in
    >the global.asax
    >file.
    >
    >Thanks!
    >
    Scott Allen, May 6, 2005
    #2
    1. Advertising

  3. Leon

    Leon Guest

    That it. Thanks Scott!!!!!!!!!!!!!!!!!!!
    "Scott Allen" <> wrote in message
    news:...
    > Hi Leon:
    >
    > From your description it sounds as if what you want to do is possible.
    > You want to read about a topic known as URL rewriting.
    >
    > Here is an article to get you started:
    > http://msdn.microsoft.com/asp.net/c...l=/library/en-us/dnaspp/html/urlrewriting.asp
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Fri, 6 May 2005 06:54:51 -0500, "Leon" <> wrote:
    >
    >>How do I point a sub-domain to a sub-directory or .aspx page of my site
    >>using
    >>asp.net?
    >>
    >>I'm using a shared hosting service, that does not offer subdoman
    >>forwarding.
    >>however, you can write your own asp.net redirect code, and I just want to
    >>the best way to accomplish this task. it's possible that I may could have
    >>a
    >>1000
    >>subdomain names to redirect, but within the same application, to the same
    >>page
    >>within the aplication that then get some data from the database to format
    >>the current page.
    >>
    >>I know it is possible for me to forward all subdomain name to my site
    >>using
    >>the wildcard(*),
    >>but is it possible to send all subdomain to the same .aspx page than get
    >>the
    >>beginning of the
    >>current subdomain such as ("leon.mydomain.com") leon with then grab some
    >>leon information
    >>from the database to format the page?
    >>
    >>I know normally domains are setup to point to the root directory of the
    >>web
    >>site. However, how can I detect which URL a person is browsing to on my
    >>site
    >>with ("such as leon.mydomain.com"), and redirect them to the appropriate
    >>place on within site ("such as
    >>mydomain.com/display.aspx?UserId=1&DisplayId=10"),
    >>and where do I want to put this code in default page of the website or in
    >>the global.asax
    >>file.
    >>
    >>Thanks!
    >>

    >
    Leon, May 6, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Horton
    Replies:
    1
    Views:
    342
    Michael Horton
    Apr 20, 2004
  2. bertin

    application subdomain Asp.net

    bertin, Nov 30, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    382
    bertin
    Nov 30, 2005
  3. Fastau B

    redirect to subdomain

    Fastau B, Mar 19, 2006, in forum: ASP .Net Security
    Replies:
    0
    Views:
    126
    Fastau B
    Mar 19, 2006
  4. saify
    Replies:
    0
    Views:
    870
    saify
    Sep 28, 2009
  5. RyanRitten
    Replies:
    2
    Views:
    103
    RyanRitten
    Jul 3, 2008
Loading...

Share This Page