Forum Discussion
Glenn_Ruffus_10
Nimbostratus
Oct 31, 2007wildcard 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_12Historic F5 AccountIt 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]" } }
- Glenn_Ruffus_10
Nimbostratus
Thanks, Colin! I'll give it a try. - Glenn_Ruffus_10
Nimbostratus
Your suggestion worked perfectly. Thanks *so* much, Colin!
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects