urlrewriter url重写 伪静态配置

一、引入URLRewriter.dll和ActionlessForm.dll

二、webconfig修改

在<configuration>里面添加<configSections>
  <configSections>
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
  </configSections>

在<system.web>的<httpHandlers>里面添加

<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />

<configuration>里面添加

<RewriterConfig>
    <Rules>
      <RewriterRule>
        <LookFor>~/a\.html</LookFor>
        <SendTo> ~/a.aspx</SendTo>
      </RewriterRule>

</Rules>
  </RewriterConfig>

三、iis设置

属性 主目录 配置 添加

可执行文件:c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
扩展名:.html

去掉勾选确认文件是否存在

用心写代码,不辜负程序员之名。
原文地址:https://www.cnblogs.com/thinkingthigh/p/2772779.html