I'm running Asp.net MVC application. By default web.config sets all
modules to run for all requests which I disabled. I have a custom
HttpModule that's responsible for authentication of managed requests.
Part of my web.config looks like this:
<modules>
<add name="CustomAuth" type="..." preCondition="managedHandler" />
</modules>
Then I try to access my site via http://localhost/default.aspx
All works fine. My Handler gets invoked since IIS integrated pipeline thinks it's managed request. Great.
Then I try to access my site via http://localhost/
Suddenly IIS7 thinks this is <b>not managed request</b>. So
I put default.aspx on top of Default documents, to convince IIS that
this is in did managed request, but to no avail... This request should be treated as managed so this is a bug. I should point out, that I'm using NetFx 3.5 SP1. As I've read elsewhere, this used to work before.
So I would like to:
- configure IIS (via management UI or web.config) to run modules
certain modules only for managed requests and not for static content as
well
- avoid configuring running all modules on all requests
I guess the culprit is StaticFile module. Could I use
UrlRewriting module because (AFAIK) it executes before StaticFile
module? Any other suggestion? Could I reorder handlers so another handler would execute before StaticFile that would make it possible to treat folder requests as managed content based on default document.