IIS7下使用urlrewriter.dll配置

<configuration>节点下添加

<configSections>
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
  <Rules>
    <RewriterRule>
      <LookFor>~/1.html</LookFor>
      <SendTo>~/index.aspx</SendTo>
    </RewriterRule>
    <RewriterRule>
      <LookFor>~/index.html</LookFor>
      <SendTo>~/index.aspx</SendTo>
     </RewriterRule>
  </Rules>
</RewriterConfig>

<system.web>节点下添加

<httpModules>
      <add type="URLRewriter.ModuleRewriter,URLRewriter" name="ModuleRewriter" />
</httpModules>

<system.webServer>节点下添加

<handlers>   
    <add name="all" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32" />     
        <add name="HmlHandler" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
</handlers>
原文地址:https://www.cnblogs.com/Kuleft/p/5328192.html