IIS 7 and URL Rewrite

By Akbar

I have been using IIS 6 (and some older versions) for a long time for many of the clients website. One of the biggest feature I miss is the URL Rewrite component. Apache support this module for so long, and it’s must have for friend URLs.

Fortunately, due to powerful ISAPI support, there are already many powerful 3rd Party applications available which provides really good URL Rewrite support. I would like to mention two of these:

However, I recently needed to use the similar function on one of client website which is running on IIS 7, and before trying any of these 3rd Party tools, I decided to search and see if IIS 7.0 support and Viola! It does. The URL Rewrite module in IIS 7 is not only as powerful as you would expect it to be (supporting most of the Apache counterpart URL rewrite module), but its integration in the IIS Manager is a big plus. You can easily add and test rules them using the visual interface. Here is a very good beginner tutorial:

For some of the geeky fans, who still like the type this instead of wasting time in UI dialog, these rewrite rules are stored in your website web.config file, so you can view, add or edit these directly there too. Here is a sample of how these rules appear in the web.config file:


You still have to type more than you have to do for something similar in Apache and other 3rd Party URL rewrite tools, but this is because of the XML syntax, and there price you have to pay for better (debatable) data format.

Tags: ,