ASP.NET 静态化

以前也说过页面静态化   但是说的好像不清楚

  这次我用一个插件 URLRewriter  重写URL

先引用dll 然后再web.config中三步走

<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler,URLRewriter"/>
</configSections>

<!--第一步-->


<system.webServer>
<handlers>
<add path="*.html" type="URLRewriter.RewriterFactoryHandler" verb="*" name="urlrewriter"/>
</handlers>
</system.webServer>
<!--第二步-->


<RewriterConfig>
<Rules>
<RewriterRule>
<!--Goods_0.html-->
<LookFor>~/Login+.html</LookFor>
<SendTo>~/Login.aspx</SendTo>
</RewriterRule>
<!--<RewriterRule>
<!--Goods_0.html-->
<LookFor>~/User/index+.html</LookFor>
<SendTo>~/User/Default.aspx</SendTo>
</RewriterRule>-->


</Rules>
</RewriterConfig>
<!--第三部modes.aspx-->

原文地址:https://www.cnblogs.com/whatarey/p/9568343.html