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开发框架
上一篇:关于模型生成
评论列表

发表评论

评论内容
昵称:
关联文章

IISURL定向配置
IIS URL定向VUE配置
nginx配置http自动定向到https
windows下openssl安装,证书生成,nginx配置https以及http定向https
IIS应用程序池自动停止,启报错
IIS程序池回收配置
IIS配置允许跨域访问
C#URL编码
nginx集群按照url规则指定节点访问
.NET大型项目开发必备(4)--数据库的读分离
C#使用默认浏览器打开URL
业务模块特殊URL配置
.NET IIS第一次访问慢,程序池被回收问题,IIS初始化(启用预加载)
权限配置
ASP.NET MVC和ASP.NET Core MVC获取当前URL/Controller/Action
docker安装gitlab root密码
微信授权连接URL生成类库
nginx配置指南
IIS初始化(预加载),解决第一次访问慢,程序池被回收问题
获取URL参数的几种方式