Forum Discussion
Frank_Ziebarth_
Nimbostratus
Jun 16, 2006rewrite an URI with a request parameter
Hallo
we have two webservices in the development, so the the uri is change very often.
Our end-user should connect to these server to an easy URI
http://server/portal/
http:/...
hoolio
Cirrostratus
Jun 16, 2006HTTP::uri refers to the entire URI, including the query string. So when you are setting the URI with HTTP::uri "/version02.webservices.portal/" or HTTP::uri "/version04.webservices.info/", you are overwriting the entire URI.
If you want to replace the instance of /portal/ with /version02.webservices.portal/ and leave the rest of the URI intact, you can use string map:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/portal/" } {
HTTP::uri [string map { /portal/ /version02.webservices.portal/ } [HTTP::uri]]
pool SDS_Pool01
}
elseif { [HTTP::uri] starts_with "/info/" } {
HTTP::uri [string map { /info/ /version04.webservices.info/ } [HTTP::uri]]
pool SDS_Pool02
}
}
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
