Asp – Stop ASP.NET from handling 404 errors for files with extensions (not IIS)

asp.netiis-7

I'm using IIS7 and ASP.NET. Basically building a simple CMS and need to handle .htm and .html file extensions (served by dynamic asp.net pages).

I have it setup so IIS7 passes the page to asp.net (not the static handler); however, ASP.NET knows the file doesn't exist and redirects to its 404 (404.aspx?aspxerrorpath=xx) before I can do what I need to with it (parse teh url and display the correct page).

I'm using IIS7 url rewrite module to do the rewtitting.

Best Answer

This might be what you are looking for, although I'm not sure:

http://www.west-wind.com/Weblog/posts/745738.aspx