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:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32" />     
        <add name="HmlHandler" path="*.html" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
</handlers>

 

posted @ 2016-03-28 10:54  kuleft  阅读(611)  评论(0编辑  收藏  举报