I have a website using ISAPI Rewrite , as well as a custom HttpModule that redirects and rewrites Url.
In IIS 6, everything worked fine: the ISAPI rewrite filter starts first, followed by the HttpModule. In IIS 7 (Integrated Mode), the order is now reversed, which creates a problem.
My problem in particular is that the HttpModule has a condition in which it will issue a rewrite of Url using context.RewritePath . It will explicitly add "index.aspx" to the path if the document was not provided, so the request for /test/ will be rewritten to /test/index.aspx .
At some point after the path is rewritten, the ISAPI filter is intercepted. We have a rule opposite to the module: a request to /test/index.aspx receives a 301 redirect to /test/ . So we have an infinite loop.
How is the execution order of the HttpModules and ISAPI filters in IIS 7 determined? Can I reorder? I found this question , but that did not help. I am not a master of IIS 7, but to some extent I understand that ISAPI modules and filters work "together." Unfortunately, they are still managed differently, and I cannot figure out how to get someone to work in front of another. Help!
Note. Suppose I cannot modify existing code. It worked in IIS 6. I just want to know if there is a way to make it work in IIS 7 integrated mode.
Kurt schindler
source share