(I don\'t know whether should I also post this question to ServerFault, since it\'s about IIS configuration?)
In IIS7 we can tell a module to run for manage
The problem is in request-processing order. IIS7 processes requests in order specified by Handlers configuration element of IIS. By default Handlers element of the IIS configuration contains
at the end of the handlers. Therefore all request that not match any previously specified handler, will be processed by this handler (including folder request too).
You can remove all default handlers by using clear element in handlers configuration and specify your own request processing order.
I recommend to copy default IIS handlers configuration (C:\Windows\System32\inetsrv\config\applicationHost.config) to your web config without StaticFile handler at the end.
Then you should add specific static content handler for each static content type (jpg, gif, js, css).
and manged handler (PageHandlerFactory) for folder requests after that.
At the end you should also add StaticFile handler.
Here is an example.