-
1. Re: Rewrite using undertow's configuration
daribo Jun 20, 2014 8:28 AM (in response to daribo)OK, I figured it out.
In order to set a parameter to the rewrite rule, you need to specify it in the NEXT line (not in the same - won't work).
e.g.
regex['^/Shoes/$'] -> rewrite['/showShoes.action']
set[attribute='%{q,gender}', value='men'];
Now, I still need to find a way to set NC (case-insensitive)...
-
2. Re: Rewrite using undertow's configuration
daribo Jun 23, 2014 4:57 AM (in response to daribo)In order to set the Method parameter to GET or POST, you would need to do this:
method[GET] and regex['^/Shoes/$'] -> rewrite['/showShoes.action']
-
3. Re: Rewrite using undertow's configuration
karthik-vasishta.ramesh Jan 13, 2015 7:16 PM (in response to daribo)Hi Tom,
I'm looking for a solution to set NC in undertow-handlers.conf as well. Where you able to figure it out?
-
4. Re: Rewrite using undertow's configuration
karthik-vasishta.ramesh Jan 15, 2015 5:13 PM (in response to karthik-vasishta.ramesh)Ok, I am now almost certain that flags cannot be set in undertow-handlers.conf.
I got to know that the java class named: 'RegularExpressionPredicate.java' is responsible for parsing regexes, and this is not setting any flags (as seen here):
undertow/RegularExpressionPredicate.java at master · undertow-io/undertow · GitHub
The only alternative is to use character classes. This clumsy rule worked for me:
regex['^/[Ll][oO][gG][iI][nN]/$']-> rewrite['/index.html']
I have raised a JIRA ticket (feature request) with Undertow for this issue.
Please let me know if there is any solution to this. I will modify/cancel this ticket accordingly.