URLRewriter 伪静态配置Demo

URLRewriter 伪静态配置Demo 示例源码:

web.config配置:

<?xml version="1.0"?>
<!--
  有关如何配置 ASP.NET 应用程序的详细信息,请访问
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <!--使用URLRewriter.dll -->
  <configSections>
    <section name="RewriterConfig" requirePermission="false" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
  </configSections>
  <RewriterConfig>
    <Rules>
      <RewriterRule>
        <LookFor>~/detail.html</LookFor>
        <SendTo>~/detail.aspx</SendTo>
      </RewriterRule>
    </Rules>
  </RewriterConfig>
  <!--使用URLRewriter.dll -->
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
  </system.web>
  <system.webServer>
    <handlers>
      <add name="test1" verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
      <add name="test2" verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>
</configuration>

原文地址:https://www.cnblogs.com/hongz29299/p/5121959.html