【发布时间】:2021-06-16 16:38:18
【问题描述】:
我想将 url 重写为 index.html。下面的 web.config 完成这项工作,直到第一个路径。 例如:- test.com/test1 到 test.com/index.html 但它不适用于多个路径。例如:- test.com/test1/test2
我当前的 web.config
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="redirect all requests" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="index.html" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我不确定我在这里缺少什么。如果你们知道,请写下正确的 web.config。 谢谢。
【问题讨论】:
标签: regex redirect iis url-rewriting web-config