【发布时间】:2012-02-24 04:35:59
【问题描述】:
我浏览了整个网络,但似乎无法弄清楚这一点。我正在使用 Tuckey 重写引擎。我已经阅读了手册并在没有帮助的情况下查看了示例。
我想从 URL 中删除“.html”扩展名,同时保留参数(如果有的话)。
这是我目前所拥有的(非工作):
<rule>
<note>Example: http://hostname/sample/loginhelp?cid=2 is masked from http://hostname/sample/loginhelp.html?cid=2</note>
<from>^(.*)\?(.*)$</from>
<to>$1.html?$2</to>
</rule>
<outbound-rule>
<note>Example: http://hostname/sample/loginhelp.html?cid=2 is redirected to http://hostname/sample/loginhelp?cid=2</note>
<from>^(.*)(\.html)(.*)$</from>
<to type="redirect">$1$2</to>
</outbound-rule>
规则或出站规则似乎在任何情况下都不起作用。我知道 Tuckey 正在工作,因为我可以让其他规则起作用,但不是这个。另外,虽然我认为这并不重要,但我正在使用 Seam 堆栈。我错过了什么?
【问题讨论】:
标签: regex url-rewriting wildcard http-redirect tuckey-urlrewrite-filter