This is my
<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 is redirectiing well to www.example.com
but the problem is http://example.com/resetpassword/?user=2560256&token=1233
is redirected to http://example.com/resetpassword
To preserve the query string, you can add the
use-query-string
parameter to theurlrewrite
element as follows:Alternatively, you can include the query string in your redirect URL as follows:
See the documentation here.