redirection

Discussion in 'ASP .Net' started by lam, Aug 18, 2006.

  1. lam

    lam Guest

    I'm wondering if there is an easy way to implement a redirection.
    For example: http://test.com/redirect would redirect to
    http://test.com/redirect.aspx


    In the past, I have to implement redirect as a virtual directory under
    test.com and have redirect logic to redirect.aspx. But this seems like
    a lot of work involved.

    Thanks,
    Lam
     
    lam, Aug 18, 2006
    #1
    1. Advertising

  2. lam

    r2thej151 Guest

    drop this as a default.htm file into the virtual directory.

    <HTML>
    <HEAD>
    <!-- Send users to the new location. -->
    <TITLE>redirect</TITLE>
    <META HTTP-EQUIV="refresh"
    CONTENT="10;URL=http://www.netmechanic.com">
    </HEAD>
    <BODY>
    This page has moved. You will be
    automatically redirected
    to its new location in 10 seconds.
    If you aren't forwarded
    to the new page,
    <a href="http://www.netmechanic.com">
    click here</a>.
    </BODY>
    </HTML>

    Here's a link to the article
    http://www.netmechanic.com/news/vol2/html_no5.htm
     
    r2thej151, Aug 18, 2006
    #2
    1. Advertising

  3. lam

    lam Guest

    Thanks.
    Actually, I am wondering if we can do away with having to create
    virtual directory.
    For example, in case of the web site tfd:, if you type:
    http://www.tfd.com/computer,
    it automatically captures the word: "computer", without having to
    create a virtual dir called "computer"
    Regards,
    Lam
    r2thej151 wrote:
    > drop this as a default.htm file into the virtual directory.
    >
    > <HTML>
    > <HEAD>
    > <!-- Send users to the new location. -->
    > <TITLE>redirect</TITLE>
    > <META HTTP-EQUIV="refresh"
    > CONTENT="10;URL=http://www.netmechanic.com">
    > </HEAD>
    > <BODY>
    > This page has moved. You will be
    > automatically redirected
    > to its new location in 10 seconds.
    > If you aren't forwarded
    > to the new page,
    > <a href="http://www.netmechanic.com">
    > click here</a>.
    > </BODY>
    > </HTML>
    >
    > Here's a link to the article
    > http://www.netmechanic.com/news/vol2/html_no5.htm
     
    lam, Aug 18, 2006
    #3
  4. lam,
    What you describe is referred to as "URLRewriting".
    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "lam" wrote:

    > Thanks.
    > Actually, I am wondering if we can do away with having to create
    > virtual directory.
    > For example, in case of the web site tfd:, if you type:
    > http://www.tfd.com/computer,
    > it automatically captures the word: "computer", without having to
    > create a virtual dir called "computer"
    > Regards,
    > Lam
    > r2thej151 wrote:
    > > drop this as a default.htm file into the virtual directory.
    > >
    > > <HTML>
    > > <HEAD>
    > > <!-- Send users to the new location. -->
    > > <TITLE>redirect</TITLE>
    > > <META HTTP-EQUIV="refresh"
    > > CONTENT="10;URL=http://www.netmechanic.com">
    > > </HEAD>
    > > <BODY>
    > > This page has moved. You will be
    > > automatically redirected
    > > to its new location in 10 seconds.
    > > If you aren't forwarded
    > > to the new page,
    > > <a href="http://www.netmechanic.com">
    > > click here</a>.
    > > </BODY>
    > > </HTML>
    > >
    > > Here's a link to the article
    > > http://www.netmechanic.com/news/vol2/html_no5.htm

    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Aug 18, 2006
    #4
  5. lam

    r2thej151 Guest

    > Thanks.
    > Actually, I am wondering if we can do away with having to create
    > virtual directory.
    > For example, in case of the web site tfd:, if you type:
    > http://www.tfd.com/computer,
    > it automatically captures the word: "computer", without having to
    > create a virtual dir called "computer"
    > Regards,
    > Lam


    Go into the properties of the website you want to handle the url. On
    the WebSite tab click advanced. Now you just add the desired host
    header name into the multiple identities for this website area. Now
    when a request comes into that machine IIS will send all requests for
    that specific URL into the website you defined the header.

    Here's an easy example. Note: you will be adding an entry not editing
    one.
    http://www.tek-tips.com/viewthread.cfm?qid=53743&page=1447

    Hopefully that makes sense...
     
    r2thej151, Aug 18, 2006
    #5
  6. lam

    lam Guest

    Actually, what I was looking for is exactly as Peter refered to, "URL
    Rewrite."
    This would allow me to dynamically redirect pages at runtime by
    modifying the configuration file.
    Thanks everyone for replying.
    Lam
    r2thej151 wrote:
    > > Thanks.
    > > Actually, I am wondering if we can do away with having to create
    > > virtual directory.
    > > For example, in case of the web site tfd:, if you type:
    > > http://www.tfd.com/computer,
    > > it automatically captures the word: "computer", without having to
    > > create a virtual dir called "computer"
    > > Regards,
    > > Lam

    >
    > Go into the properties of the website you want to handle the url. On
    > the WebSite tab click advanced. Now you just add the desired host
    > header name into the multiple identities for this website area. Now
    > when a request comes into that machine IIS will send all requests for
    > that specific URL into the website you defined the header.
    >
    > Here's an easy example. Note: you will be adding an entry not editing
    > one.
    > http://www.tek-tips.com/viewthread.cfm?qid=53743&page=1447
    >
    > Hopefully that makes sense...
     
    lam, Aug 19, 2006
    #6
    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. MadHatter

    input redirection

    MadHatter, Oct 14, 2003, in forum: Perl
    Replies:
    6
    Views:
    695
    MadHatter
    Oct 16, 2003
  2. S
    Replies:
    1
    Views:
    817
  3. Matt
    Replies:
    0
    Views:
    309
  4. headware

    controlling redirection within frames

    headware, Aug 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    331
    headware
    Aug 5, 2003
  5. Ravikanth[MVP]

    Redirection pronblem

    Ravikanth[MVP], Aug 11, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    315
    Platino
    Aug 11, 2003
Loading...

Share This Page