【问题标题】:Remove index.cfm by IIS URL rewriting通过 IIS URL 重写删除 index.cfm
【发布时间】:2014-11-14 18:13:07
【问题描述】:

如果没有 query_string,我想删除 URL 中的 index.cfm,例如www.mysite.com/index.cfm 将被重写为 www.mysite.com'www.mysite.com/Test/index.cfm 将被重写为 'www.mysite.com/Test/ 但如果 url 中有 querstring 则 url 不会受到影响,例如'www.mysite.com/Test/index.cfm?u=5 不受重写规则影响。

我怎样才能得到它?

【问题讨论】:

  • 改用www.mysite.com/Test/?u=5怎么样?

标签: iis coldfusion iis-7 iis-7.5 coldfusion-10


【解决方案1】:

这对我来说很完美

<rule name="Default Document" stopProcessing="true">
    <match url="(.*)index.cfm" />
    <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
        <add input="{PATH_INFO}" pattern="^.*(/index.cfm/).*$" negate="true" />
        <add input="{QUERY_STRING}" pattern=".+" ignoreCase="false" negate="true" />
    </conditions>
    <action type="Redirect" url="{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>

【讨论】:

    猜你喜欢
    • 2013-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-30
    • 2012-05-03
    • 2015-08-20
    • 1970-01-01
    相关资源
    最近更新 更多