我想将来自模式的所有流量(带有所有参数等)重定向http://myIntranet/*
到http://myIntranet.domain.com/*
我在 urlrewrite.xml 中设置了以下配置:
<rule>
<name>Canonical Hostnames</name>
<note>
The goal of this rule is to force the use of a particular hostname, in preference to other hostnames which
may be used to reach the same site. For example, if you wish to force the use of www.example.com instead of
example.com, you might use a variant of the following recipe.
RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R]
</note>
<condition name="host" operator="notequal">^myIntranet\.domain\.com</condition>
<condition name="host" operator="notequal">^$</condition>
<from>^/(.*)</from>
<to type="redirect" last="true">http://myIntranet.domain.com/$1</to>
</rule>
这对于这种情况类型是可以的:当您转到 时http://myIntranet/
,您将被重定向到http://myIntranet.domain.com/
但是当你去它时http://myIntranet/something/viewpage.action?pageId=529509
它并不好,因为它忽略了后缀 tu 基本 URL 的某些部分。我希望它重定向到http://myIntranet.domain.com/something/viewpage.action?pageId=529509
有什么建议么?
编辑:
我找到了解决方案。我只需要像这样添加qsappend="true"
标签to
:
<to type="redirect" last="true" qsappend="true">http://myIntranet.domain.com/$1</to>
使用此配置和调用 URL:
http://myIntranet/something/viewpage.action?pageId=529509
我得到:
http://myIntranet.domain.com/something/viewpage.action&pageId=529509
现在,问题是 UrlRewriteFilter 出于某些未知原因切换?
为&
我还在Google Code 上的 UrlRewriteFilter 存储库上发布了问题。
有什么建议么?