netnr / web.config
2020-05-17 08:43
IIS 重写 URL,移除 .html 后缀,依赖 URL Rewrite
<!-- web.config -->

<configuration>
  <system.webServer>
  
    <rewrite>
      <rules>
        <rule name="RewriteHTML">
          <match url="(.*)" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="{R:1}.html" />
        </rule>
      </rules>
    </rewrite>

  </system.webServer>
</configuration>

<!--URL Rewrite 下载地址:https://www.iis.net/downloads/microsoft/url-rewrite -->
ˆ