asp.net伪静态页面处理

1.web.config
 <configSections>
...
    <RewriterConfig>
  <Rules>
   <RewriterRule>
    <LookFor>~/index.html</LookFor>
    <SendTo>~/index.aspx</SendTo>
   </RewriterRule>
    <RewriterRule>
    <LookFor>~/sell_all.html</LookFor>
    <SendTo><![CDATA[~/sell.aspx?uncorp=0]]></SendTo>
   </RewriterRule>
   <RewriterRule>
    <LookFor>~/sell/detail/(\d{1,4})/(\d{1,2})/(\d{1,2})/(\d{1,10})\.html</LookFor>
    <SendTo><![CDATA[~/sell_detail.aspx?id=$4]]></SendTo>
   </RewriterRule>

...

  <compilation debug="true">
   <assemblies>
          <!-- 加上此节点,保证原本就是.html类型的文件能正常访问 -->
      <buildProviders>
        <add extension=".html" type="System.Web.Compilation.PageBuildProvider" />
      </buildProviders>
    </compilation>

2.URLRewriter.dll copy 到 bin目录下

3.IIS文件映射增加.html类型

原文地址:https://www.cnblogs.com/lljinz/p/2419208.html