Wednesday, October 21, 2009

Firing HttpModule on a file that does not exist physically

I am not going to explain what an HttpModule is and how to create one. There are hundreds of posts in Google that explain the same with nice screen shots.

This article here is a good example for some one who just started to learn about them

I knew that a HttpModule when configured properly has to intercept each and every request that reaches the web app it has been set on. But by default, the HttpModule fires only if the file exists on the server physically.

With a configuration change in IIS, I had been able to fire the HttpModule for every request irrespective of whether the file exists or not physically.

Step-1
Open up the properties of website and go to the tab "Home Directory"


Step-2
Click "Configuration", add a wildcard application map as shown below(aspnet_isapi.dll). Make sure that "Verify that file exists" is checked off

No comments:

Post a Comment