【发布时间】:2021-08-04 06:57:33
【问题描述】:
我在 IIS 中有以下针对 Angular 应用程序的重写规则:
<rewrite>
<rules>
<rule name="Angular Routes1" enabled="true" stopProcessing="true">
<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="index.html" />
</rule>
<rule name="HTTPS Redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://www.example.com{REQUEST_URI}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
当有人浏览http://www.example.com时,它被重定向到https://www.example.com,但是当我使用设置网站的路由时,例如:
http://www.example.com/layout/dark 没有重定向到https://www.example.com/layout/dark
我想知道我添加两条规则时是否出错,应该全部添加到一条规则中。
谢谢。
【问题讨论】: