July 4, 2008

Url Rewriting in IIS 7

One thing I like in IIS 7 is the way it supports Url rewriting. Earlier versions of IIS (6,5) does not support ASP.NET HttpModules for urls without a file extenstion. i.e. http://localhost/Products. Even if its doesn't we can hackaround and use it with IIS Error pages.

When there is no file extension in the url, IIS directly processing it with its own ISAPI filter rather than processing it through the ASP.NET handler. But with IIS 7, all we have to do is to add the HttpModule into the IIS web app. All the requests are process through the HttpModule. So if we request http://localhost/Products, it will go through the HttpModule, which we can easily integrate our url rewriting.