URL Rewriting under IIS
October 21st, 2006 by Ivan Uzunov
Since I’m an ASP.NET developer I’ll share my experience with URL rewriting options that I have tried in mine, guess what, ASP.NET web sites. So far I know three options to do this task:
- ASP.NET 2.0 Mapping
- Using UrlRewritingNet.UrlRewrite
- Using ISAPI Rewrite filter - this is the most powerful option.
ASP.NET 2.0 URL Mapping
The build in URL mapping has really limited features. It can only rewrite static URLs to other static URLs.
To use the URL mapping you need to add the rewriting rules in the in the section of the web.config file:
<system.web>
<urlMappings enabled="true">
<add url="~/home.aspx" mappedUrl="~/default.aspx"/>
</arlMappings>
</system.web>
I assume that Microsoft will not put much an effort to extend the features of URL Mapping since IIS 7.0 will support URL Rewriting. Anyway in some cases this could be useful so I’m happy to have this option.
Using UrlRewritingNet.UrlRewrite
The rewriting rules are located in the web.config file.
You can find it here: http://www.urlrewriting.net
Using ISAPI Rewrite filter
The rewriting rules are located in a simple INI file named httpd.ini. This file should be located in the web site root folder. If you use Windows XP the root folder of the Default Web Site is usually C:\Inetpub\wwwroot.
You can find it here: http://www.isapirewrite.com/
ASP.NET, ISAPI Rewrite, URL Mapping, URL Rewriting, UrlRewritingNet


