urlrewritefilter
urlrewritefilter copied to clipboard
URL Rewrite Filter not working with query parameters containing special characters
What steps will reproduce the problem?
Referring to Conditions Based On URL Parameters, I’ve done something using
UrlRewriteFilter which is actually required to make my site Google crawl-able.
Here’s how it goes.
<rule enabled="true">
<note>
The rule means that requests to /test/status/ will be redirected to /rewrite-status
the url will be rewritten.
</note>
<condition type="parameter" name="_escaped_fragment_" operator="equal">(apple|kiwi|orange)</condition>
<from>^/mysite/(.+)/(.*)$</from>
<to type="redirect">/mysite/%{parameter:_escaped_fragment_}</to>
</rule>
It fails throwing java.lang.IllegalArgumentException: URLDecoder: Illegal hex
characters in escape (%) pattern – %%7. As my variable contains underscores
(_escaped_fragment_), where in it works fine with a parameter variable called
‘friuit’.
What is the expected output? What do you see instead?
The url which should have been redirected to
http://myurl.com/mysit/targetpage.html
It is going to
http://myurl.com/mysite/%%7Bparameter:_escaped_fragment_%7D
As an error is shown in my server console.
java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern – %%7.
What version of the product are you using? On what operating system?
Url Rewrite Filter 4.0.3
Please provide any additional information below.
Original issue reported on code.google.com by [email protected] on 27 May 2014 at 2:11
Attachments: