Reputation: 24741
I'm trying to tame urlrewritefilter, and it looks like like when one rule with redirect matchs another rule with forward I won't see the URL I'm redirecting in the address bar, as expected.
Here is a snippet of config:
<rule>
<from>/patha</from>
<to type="redirect">/pathb</to>
</rule>
<rule>
<from>/pathb</from>
<to type="forward">/pathc</to>
</rule>
What I am expecting to be done by this rules while I'm trying to access to patha
patha
redirect my browser to pathb
, the URL in address bar is changing.pathb
is also a good match, so browser get forwarded to pathc, but, because this is forward, the URL in address bar remains pathb.But actually what is happening is that I'm forwarding to pathc without any changes in address bar.
My question is: Why is this so and how I can actually achieve what I am seeking for?
UPD: I've tested urlrewritefilter forward with redirection in jsp via:
response.setStatus(302);
response.setHeader("Location", "pathb");
response.setHeader("Connection", "close");
The result is the same - URL is not rewritten.
Upvotes: 0
Views: 1878
Reputation: 4829
What you are noticing is the expected behaviour. With forward
you will never see the URL in the browser. Please see below differences between forward
and redirect
:
Forward
Redirect
Upvotes: 6