I have a .net website which contains an IHttpModule I wrote to do certain tasks (authorisation etc). But within the website there are a number of virtual directories that are mapped to third party applications which unfortunately I can't change or move (e.g. community server forums, adxstudio cms and others).
I am looking for a way to prevent my IHttpModule from running when requests are made for the contents of those virtual directories. Is this possible?
[Edit - added the following]
I have been experimenting with adding <remove name="X"/>
inside the <httpModules>
node in the Web.config files in the virtual directory applications but it doesn't seem to be working out. It probably isn't a great solution either because the third party applications can be updated so I don't want to require changes to their code/ configuration.
I also tried adding a <location path="." inheritInChildApplications="false">
around my <system.web>
node in the parent Web.config but that also didn't seem to work.
[Edit again - added more]
The reason is doesn't work is because the IHttpModule's Init event is only fired once per application lifecycle (rather than per request as I had assumed). Since I add a bunch of event listeners in the init event these are still fired on subsequent requests...