mod_rewrite is one of the most useful modules for Apache.
But what do you do on a Windows IIS server? I could only find a few commercial ISAPI modules (ISAPI ReWrite, IIS Rewrite). This is one of the most painful gaps on the Windows platform.
Since I only needed a few rewrite features at the time, I decided to build my own. An early version is available from the CVS repository — anonymous CVS, no password required.
The RewriteCond feature has not been implemented yet. Sorry — it was only an afternoon’s work, and I am still a newbie on the ASP.NET platform.
Here is the sample configuration:
<configuration>
<configsections>
<section
name="rewriteSection"
type="Dragonsoft.RewriteConfigurationSection, Dragonsoft.RewriteModule" />
</configsections>
<system .web>
<httpmodules>
<add name="rewrite" type="Dragonsoft.RewriteModule" />
</httpmodules>
</system>
<rewritesection>
<![CDATA[
RewriteRule ^~/news/([^/]+)/([^/]+)\.html$ ~/news.aspx?id=$1&name=$2 [L]
RewriteRule \fake\(.*).html$ \real\$1.aspx [NC,L]
]]>
</rewritesection>
</configuration>
–update: URL Rewrite Filter for IIS is open source. I have not tested it.