Forum Discussion
Jakov_40007
Nimbostratus
Mar 26, 2010HTTP::path and HTTP::query question
I am new to iRules and having difficulty writing a rule that will rewrite a request from the client to a server by replacing the 'path' but will still retain the query string that follows. I have wri...
hoolio
Cirrostratus
Mar 26, 2010That seems like a bug. HTTP::path should only return or set the path in the URI without retrieving or modifying the query string. You could work around this using HTTP::uri instead:
when HTTP_REQUEST {
Check if path is /
if {[HTTP::path] eq "/"}{
Parse the URI into the path and query
scan [HTTP::uri] {%[^?]?%s} path query
Check if there was a query
if {[info exists query]}{
Update path, preserving query
HTTP::uri "/en-CA/default.htm?$query"
} else {
Update path without query
HTTP::uri "/en-CA/default.htm"
}
}
}
I'd also suggest opening a case with F5 Support on the possible bug with HTTP::path removing the query string. Which LTM version are you running?
Aaron
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