Forum Discussion

Glenn_Ruffus_10's avatar
Glenn_Ruffus_10
Icon for Nimbostratus rankNimbostratus
Oct 31, 2007

wildcard query string

I am working on a HTTP redirect iRule and am having trouble. I would like to use some kind of wildcard so that the "if" statement will match *any* query string found in an HTTP GET that uses the specified URI.

 

 

Then, I want to capture whatever the query string was in the GET and insert it automatically into the redirect. Here is what I have so far:

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] equals "/corporate/login.jsp?WILDCARD FOR ANY QUERYSTRING HERE" } {

 

HTTP::redirect "https://author.somedomain.com/new/login.jsp?AUTOMATICALLY INSERT THE EXACT QUERYSTRING THAT MATCHED THE WILDCARD ABOVE"

 

}

 

}

 

 

Help would be *greatly* appreciated.

 

 

Thanks

 

 

Glenn

 

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    It sounds like what you're looking for is:

    
    when HTTP_REQUEST {
      if { [HTTP::uri] starts_with "/corporate/login.jsp?" } {
        HTTP::redirect "https://author.somedomain.com/new/login.jsp?[HTTP::query]"
      }
    }

    HTH,

    Colin