奇怪的IIS重写行为

我也在Stackoverflow上问过这个问题,但我认为这将是一个更好的地方问。

我们在IIS7.5上有以下重写规则:

<rule name="Anything else to the event handler" enabled="true" stopProcessing="true"> <match url="^(.*)$" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{PATH_INFO}" pattern="^.*(/index.cfm/).*$" negate="true" /> </conditions> <action type="Rewrite" url="/index.cfm/{R:1}" appendQueryString="true" logRewrittenUrl="true" /> </rule> 

但是,它之后永远不会放入/ {R:1}。 它只是去/index.cfm。 我们需要实际获取引用variables,因为我们在ColdFusion(10)脚本中使用了这个引用variables。 我们想要一个url重写的例子:

来自: http://www.my-site.com/this.is.a.test/another.testhttp://www.my-site.com/this.is.a.test/another.test

要: http://www.my-site.com/index.cfm/this.is.a.test/another.test : http://www.my-site.com/index.cfm/this.is.a.test/another.test

任何人有一个想法,为什么不会这样做? (快速注意:执行正确的URL时可能会发生ColdFusion错误,但我不认为这会导致重写问题)

请注意,当您在浏览器中尝试使用相同的function(禁用了规则)时,它确实有效 – 只是不使用重写规则。 使用重写规则,CF中的cgi.PATH_INFOvariables返回空string。

此外,IIS确实已经将日志中的URL重写为index.cfm / this.is.a.test / another.test,这很奇怪。 使用301redirect而不是重写使它工作得很好(没有改变任何有关规则,只有动作typesredirect)。 这对我来说是非常奇怪的,因为我希望重写工作几乎和redirect一样,只是重写是内部的区别。

我们的服务器上也有Helicon Ape,所以如果你在mod_rewrite而不是IIS模块中有这个解决scheme,请给出build议。

问题是我们需要在昨天应用新的更新11之后重新做Coldfusion 10的configuration工具。 现在正在工作。