Redirect 如何为重写规则创建此例外

Redirect 如何为重写规则创建此例外,redirect,iis,url-rewriting,web-config,http-redirect,Redirect,Iis,Url Rewriting,Web Config,Http Redirect,我有以下web.config文件: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Angular Routes1" enabled="true" stopProces

我有以下web.config文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>

<system.webServer>
  <rewrite>
    <rules>
      <rule name="Angular Routes1" enabled="true" stopProcessing="true">
      <match url="(.*)" />
      <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_URI}" negate="true" pattern="^/reset-password/*" ignoreCase="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />

      </conditions>
      <action type="Redirect" url="http://example.com/index.html?utm_source={R:1}" appendQueryString="false" logRewrittenUrl="true" />
    </rule>
    </rules>
  </rewrite>
</system.webServer>

</configuration>



问题是,尽管我为
/reset password
URL定义了一个异常,但仍在对该URL进行重定向。。。正如规则名称所述,我的前端是一个有自己路由的Angular应用程序,但我需要在任何URL上具有一些重写功能,但
/reset password/tokenhere

如果要匹配/重置password/tokenhere,请尝试使用以下条件:

 <add input="{REQUEST_URI}" pattern="^/reset-password/(.*)" negate="true" />

如果您只想匹配/重置密码,请使用以下命令:

<add input="{REQUEST_URI}" pattern="^/reset-password/$" negate="true" />


图案错误。启用FRT,您将看到@LexLi应该是什么样子?出于某种原因,它将我重定向到
index.html
,如下面所示,即使它不应该是这样。有什么线索可以解决这个问题吗?是的,至少该模式现在起作用了,但我现在无法在我的Angular应用程序上访问该路径(/reset password/tokenhere)。@Munchkin请尝试清除您的历史记录并再次访问该网站。这没有帮助:/使用匿名/隐私模式也没有…@Munchkin您可以共享您失败的请求跟踪快照吗?我如何保存它?