IIS中URL重写重定向配置


利用正则表达式给子项目自动重写为自身目录下的index.html,一次配置,所有子项目都有效,不必为每个子项目配置一次

完整的配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="yesweb-common" enabled="true" stopProcessing="true">
          <match url="subapp/[^/]+\/" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="/{R:0}index.html" />
        </rule>
        <rule name="main" enabled="true" stopProcessing="false">
          <match url=".*" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="/index.html" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
YES开发框架
上一篇:关于模型生成
评论列表

发表评论

评论内容
昵称:
关联文章