Forum Discussion

Nolan_Jensen's avatar
Icon for Cirrostratus rankCirrostratus
Nov 18, 2020

Redirect to portion of a query string?

Hello All,


I am trying to figure out correct code for an iRule to redirect to a different host and append just a portion of the query string to the end of that redirect.



If customer goes to redirect them to


I am able to use code below to add ?account=12345678 to the redirect but need it to just be the account number not the ?account= part of the query string.

my code results in this:


So ideally need to parse that query statement and pull just the account number to add to end of redirect.


Any help would be greatly appreciated. Thank you!


Here is the code I have that gets me close.


  if { [string tolower [HTTP::uri]] contains "test.aspx" } {
        HTTP::redirect "[HTTP::query]"


3 Replies