Forum Discussion
How to create iRule to forward request depending on context input which has hyphen sign "-" in the url
Thank you , I got the clue. Below rule worked for me. But minor issue popping up now.
if { [HTTP::uri] starts_with "/aa/bb/cc/" } { set PREFIX_STATIC "/cs/ccs-cctc/jobs" set XX_VAL [ getfield [HTTP::uri] "-" 2] set YY_VAL [ getfield [HTTP::uri] "-" 3] set ZZ_VAL [ getfield [HTTP::uri] "-" 4] set XX_NEW [split [lindex [split $XX_VAL /] end] -] HTTP::uri "$PREFIX_STATIC?q1=$XX_NEW&q2=$YY_VAL&q3=$ZZ_VAL" }
This iRule only picking the 4 the field value "zz" not adding subsequent values to URI.
For eg. If user hit http://abc.com/aa/bb/cc/xx-yy-zz-blah-blah , endresult should be http://abc.com/aa/bb/cc?q1=xx&q2=yy&q3=zz-blah-blah
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com