Web.config httpredirect在我不想要反斜杠时插入反斜杠



我正在将一个网站更新为一个更动态的版本。在新网站中,我使用散列标签,而不是每次更改内容都新建一个页面。

我正在使用web。要重定向的目录中的配置文件,但它添加了反斜杠。有什么办法可以避免这种情况吗?我已经在重定向中处理它了,但我觉得它有点笨拙。

web.config

<?xml version="1.0"?>
<configuration>
  <system.webServer>
    <httpRedirect enabled="true" destination="/legal/#!terms-of-use" />
  </system.webServer>
</configuration>
编辑:值得一提的是,比起"/legal/#!"使用条款"it goes to"/legal/#!使用条款/"注意末尾的反斜杠

在重定向元素中打开exactDestination,如下所示:

<httpRedirect enabled="true" destination="/legal/#!terms-of-use" exactDestination="true" />

最新更新