Monday, December 10, 2012

Getting more out of IIS


Need some of you own custom code to run in IIS?


I was recently confronted with a problem regarding intercepting of web requests coming into IIS. I had to check the request for various data and redirect the user accordingly based on the data found in the request.

After much “googling” I came across IIS modules and discovered that it is quite simple to create your own module that can execute custom code for you.

For my specific problem I required a module that would intercept requests coming in to IIS. There are two options here, (for IIS 7 in my case). Option one is to write a native module, and option two is to write a managed module. I opted for the managed module which can be done in C#. In my case my class implemented the IHttpModule interface and I implemented the appropriate methods as needed.

I just want to share the concept – there is a lot of specific information out there to help with the details.


1 comment:

  1. I am going to use this on my current project. Thank you sir

    ReplyDelete