【问题标题】:URL Rewrite - Remove End of URL If Matches Specific StringURL 重写 - 如果匹配特定字符串,则删除 URL 的结尾
【发布时间】:2016-07-13 15:14:43
【问题描述】:

使用 URL 重写,我们有很多采用这种形式的旧 URL

/something/else/index.cfm
/this/that/index.cfm

我想做的是从这些示例中删除 /index.cfm

有什么想法吗?

谢谢

【问题讨论】:

    标签: iis iis-7.5


    【解决方案1】:
    <rule name="Remove Trailing Index.cfm" enabled="true">
        <match url="^(.*)/index.cfm" />
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{R:1}" pattern="category" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        </conditions>
        <action type="Redirect" url="/{R:1}" />
    </rule>
    

    【讨论】:

      猜你喜欢
      • 2019-09-10
      • 2018-05-10
      • 2020-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多