I have implemented an error handling httpmodule similar to the one
described here:
http://wiki.asp.net/page.aspx/917/neater-handling-of-exceptions/
If I run the application locally through the Visual Studio Development
Server everything works as expected. On the live server I have IIS
setup in the Aplication Configuration so that there are no ISAPI
extensions and with the wildcard mappings go to the dotnet dll, and I
have the checkbox to "Verify that the file exists" turned off.
In my web.config I have the following:
<customErrors mode="RemoteOnly" defaultRedirect="~/_errors/500-
server-error.aspx">
<error statusCode="403" redirect="~/_errors/403-forbidden.aspx"/
Quote:
|
error statusCode="404" redirect="~/_errors/404-page-not-
|
found.aspx"/>
</customErrors>
<httpModules>
<add name="HttpErrorModule"
type="tmpw.applicationname.App_Code.HttpErrorModul e, applicationname" /
And under IIS errors I have it set up so that 404 errors go to the
same 404 URL in web.config.
The behavior I am expecting is that if I go to appliationname.com/
xyz.html and it does not exist, it is kicked into the error handling
code. The error handling module is set up to log the event and I
should get an email. And even failing that the 404 page should still
load in IIS settings.
The error handling code does kick in if I go to appliationname.com/
xyz.aspx - a page which does not exist. But for any other file
extension I do not get the expected result.
Heres what happens. The application starts as expected and the code I
have in Application_BeginRequest in global.asax does get called. But
at the end of that block it stops processing. It never makes it to the
http module code. Instead I get a "The request is not supported."
response.
The application I am working on is a migration of older code. I want
to be alerted to every 404 that comes through the application so that
I can see if we missed anything. I could potentially get this sort of
information from the IIS logs I suppose but I really shouldn't have
to. Does anyone have any idea why I get a "Request Not Supported"
error when processing an HTML page, and more so, why I only get it
when running the application through IIS and not through Visual
Studio?
BTW - if this isn't the right dotnet board to post on, please point me
to the right place.
Larry.