Forum Discussion
Joe_Pipitone
Nimbostratus
Feb 09, 2010Rewriting and passing query string only, not uri
I currently have an iRule that does a rewrite and also passes the uri.
I want to ONLY catch the query string and not the uri - for example:
http://www.oursite.org/info.aspx?id=67727
should redirect to:
http://info.oursite.com/default.aspx?id=67727
therefore stripping the info.aspx and only passing the query string - is this possible? This is the iRule I currently have in place which passes the uri, but this is incorrect. Thanks for any help.
when HTTP_REQUEST {
switch [string tolower [HTTP::path]] {
"/info.aspx" {
HTTP::redirect "http://info.oursite.com/default.aspx[HTTP::uri]"
}
}
}
1 Reply
- hoolio
Cirrostratus
Hi Joe,
You can retrieve the query string (uri minus the path) using HTTP::query. For your iRule, just replace [HTTP::uri] with ?[HTTP::query].
HTTP::redirect "http://info.oursite.com/default.aspx?[HTTP::query]"
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
