473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Redirect all http requests to web application

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

Nov 18 '05 #1
1 1251
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" <Sm*********@yahoo.com> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: D. Nii | last post by:
Hi there, I have a web application that recently got redesigned and now makes use of Response.Redirect . The "new" application is hosted on Win2000 and works for all kinds of clients using IE...
2
by: Robert Gordon | last post by:
I now realize I probably should have tried posting this on the IIS board first.. I am running OWA 2003 Server as Front End server to my Exchange 2000 native domain. The FE server is secured by...
8
by: Stimp | last post by:
I need to take my website offline for an hour or so while I perform some maintenance... is it possible to create a 'catch-all' redirect to a temporary page (i.e. something in Web.config or...
2
by: Peter McEvoy | last post by:
Folks, I've been building a Webservice API for a contract that will be exposed to the internet at large. There are two endpoints, and each endpoint contains a number of webmethods. Every...
5
by: deko | last post by:
I'm trying to redirect requests for /index.php to /mydirectory/index.php If I use an index file in / with only this line: <?php header("Location:http://www.mysite.com/mydirectory/"); ?> that...
12
by: gigi | last post by:
How to send more than one value using response redirect? For example i can send one like this response.Redirect "pregled.asp?ime=" & strUserName but how to send two or more values? I tried...
12
by: =?Utf-8?B?cGI=?= | last post by:
I am having trouble doing a redirect in an async asp.net implemention. Most of the time it works, but when it doesn't it just "hangs", the browser never gets any return page. If I run it under the...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
3
by: =?Utf-8?B?UGF0UA==?= | last post by:
We have a site that gets many requests for nonexistent pages, files and folders. We want those requests redirected to the index page. However, for static files (i.e. images and some other...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.