tomcat - using UrlRewriteFilter not redirecting properly -
this
<urlrewrite> <rule> <name>canonical hostnames</name> <condition name="host" operator="equal">^example\.com</condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to type="redirect" last="true">http://www.example.com/$1</to> </rule> </urlrewrite>
it redirectiing www.example.com
problem http://example.com/resetpassword/?user=2560256&token=1233
redirected http://example.com/resetpassword
to preserve query string, can add use-query-string
parameter urlrewrite
element follows:
<urlrewrite use-query-string="true">
alternatively, can include query string in redirect url follows:
<to type="redirect" last="true">http://www.example.com/$1?%{query-string}</to>
see documentation here.
Comments
Post a Comment