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开发框架网发布内容,转载请附上原文出处连接
YESWEB YES开发框架