J
jonhyland
Hey all,
I'm writing a .NET application where I want all HTTP errors such as 404
to redirect back to the home page.
Since .NET only handles HTTP errors if the client is requesting a .NET
resource (.ASPX, whatever), I need to go into IIS -> Custom Errors tab
and set my homepage under each HTTP error I want to handle. This
allows my page to be shown if someone requests an .ASP or .HTM page
that doesn't exist.
Simple enough so far? Well when I do this, and execute the home page
normally, it gets processed *twice*. I'm not even requesting a missing
resource.
For example, my main page is Default.aspx. If in IIS I set
Default.aspx as my 404 error page, and then go to
"http://whatever.com/Default.aspx", the page is executed *twice* on the
server. If I remove the setting in IIS the behavior goes away.
A little more information some people might ask: No, the page does not
perform a Server.Transfer or Request.Redirect. The version of IIS is 6
(Windows 2003 Server). .NET Framework is 1.1. And the page consists
of a number of user controls (not sure why this would matter but
another vauge posting mentioned this).
Thanks in advance, and if anyone had more specific questions let me
know.
john
I'm writing a .NET application where I want all HTTP errors such as 404
to redirect back to the home page.
Since .NET only handles HTTP errors if the client is requesting a .NET
resource (.ASPX, whatever), I need to go into IIS -> Custom Errors tab
and set my homepage under each HTTP error I want to handle. This
allows my page to be shown if someone requests an .ASP or .HTM page
that doesn't exist.
Simple enough so far? Well when I do this, and execute the home page
normally, it gets processed *twice*. I'm not even requesting a missing
resource.
For example, my main page is Default.aspx. If in IIS I set
Default.aspx as my 404 error page, and then go to
"http://whatever.com/Default.aspx", the page is executed *twice* on the
server. If I remove the setting in IIS the behavior goes away.
A little more information some people might ask: No, the page does not
perform a Server.Transfer or Request.Redirect. The version of IIS is 6
(Windows 2003 Server). .NET Framework is 1.1. And the page consists
of a number of user controls (not sure why this would matter but
another vauge posting mentioned this).
Thanks in advance, and if anyone had more specific questions let me
know.
john