在项目的Web.config文件中确保有以下配置节
1. <configSections>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>
2. <system.web>
<httpModules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
</httpModules>
</system.web>
3.在IIS7路由不成功的主要原因是缺少以下的配置节
<system.webServer>
<httpProtocol>
<customHeaders>
<!--Compatible IE8-->
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>
<handlers>
<add name="ExtensionlessUrlHandler-ISAPI-2.0_64bit" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
<add name="ExtensionlessUrlHandler-ISAPI-2.0_32bit" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
</handlers>
</system.webServer>
以上的配置节IIS7的也可以在窗体中添加
附:
官网地址:http://urlrewriter.net/
源码下载地址:https://github.com/sethyates/urlrewriter
支持html后缀的配置方法:http://urlrewriter.net/index.php/support/installation/windows-server-2003