【问题标题】:Redirect rules to ignore folder重定向规则以忽略文件夹
【发布时间】:2020-02-27 11:11:03
【问题描述】:

我想重定向表单的所有 URL: https://example.com/foldername/friendlyurlhttps://example.com/friendlyurl 如何在 web.config 中使用重定向规则来做到这一点?

【问题讨论】:

    标签: asp.net web-config


    【解决方案1】:

    这行得通:

    <rule name="folderrule">
       <match url="(.*)(foldername/)(.*)" />
       <conditions>
          <add input="{REQUEST_FILENAME}" ignoreCase="true" />
       </conditions>
       <action type="Redirect" url="{R:1}{R:3}" />
    </rule>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-19
      • 2011-12-23
      • 2017-07-25
      • 2023-04-01
      • 2014-04-03
      • 1970-01-01
      • 1970-01-01
      • 2017-01-11
      相关资源
      最近更新 更多