Redirect all http requests to web application

Discussion in 'ASP .Net' started by Brian Smith, Feb 20, 2004.

  1. Brian Smith

    Brian Smith Guest

    Good afternoon.

    How can I force all images and static html files within an ASP.NET Web
    Application to be redirected if the user has not logged in yet via Forms
    Authentication.

    For example, I have a web application name TestWebApp with Forms
    authentication set to redirect to logon.aspx.

    If I request http://HOST/TestWebApp/anything.aspx , I am redirected to the
    logon.aspx.
    If I requset http://HOST/TestWebApp/anything.gif, the image is returned. But
    I want it to go to logon.aspx.

    Thanks.
    Brian Smith
     
    Brian Smith, Feb 20, 2004
    #1
    1. Advertising

  2. Hi Brian,

    You could write a custom HttpHandler class to do this. Map all of your
    requests for the various file types to your HttpHandler, and it will handle
    the requests. It can then Redirect, or whatever, in response to a request
    for a Resource such as a Page, image, etc.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Brian Smith" <> wrote in message
    news:uw8#YT$...
    > Good afternoon.
    >
    > How can I force all images and static html files within an ASP.NET Web
    > Application to be redirected if the user has not logged in yet via Forms
    > Authentication.
    >
    > For example, I have a web application name TestWebApp with Forms
    > authentication set to redirect to logon.aspx.
    >
    > If I request http://HOST/TestWebApp/anything.aspx , I am redirected to the
    > logon.aspx.
    > If I requset http://HOST/TestWebApp/anything.gif, the image is returned.

    But
    > I want it to go to logon.aspx.
    >
    > Thanks.
    > Brian Smith
    >
    >
    >
     
    Kevin Spencer, Feb 20, 2004
    #2
    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. Jiong Feng
    Replies:
    2
    Views:
    556
    Wade A. Hilmo [MS]
    Nov 29, 2003
  2. Fernando Arámburu

    web requests and mobile requests

    Fernando Arámburu, Apr 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    472
    Joerg Jooss
    Apr 8, 2005
  3. Andy Fish

    logging all HTTP requests

    Andy Fish, Jun 7, 2007, in forum: ASP .Net
    Replies:
    9
    Views:
    1,230
    David Wang
    Jun 7, 2007
  4. Sal
    Replies:
    1
    Views:
    989
  5. Dave Garcia
    Replies:
    5
    Views:
    660
    Dave Garcia
    Jun 5, 2009
Loading...

Share This Page