Redirect all http requests to web application

  • Thread starter Thread starter Brian Smith
  • Start date Start date
B

Brian Smith

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
 
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.
 
Back
Top