Forum Discussion

D_T's avatar
Icon for Cirrus rankCirrus
Jan 21, 2022

iRule Query String Match and Redirect

I seem to be having difficulty finding too much on this and maybe it is as simple as it is, I am looking to perform a URI match with a few particular query strings and redirect to another website if the request is found. I have found a few articles indicating using a datagroup but this seems a bit excessive for the task I am looking at.

Example: ->

Is this as simple as something like:

   if { ( [string tolower [HTTP::host]] equals "" 
) and ( [string tolower [HTTP::uri]] ends_with "Name1" ) } {
       HTTP::redirect "[HTTP::uri]"

Will the query string after the "?" be picked up and carried over with [HTTP::uri]?

3 Replies