Forum Discussion
paulfish
Nimbostratus
Sep 01, 2015Remove first element of uri
Hi,
I'm looking to remove the first element of a URI.
This is what I got from searching this site and it works.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/css" } {
...
GaganD
Nimbostratus
Sep 01, 2015Hi There,
Paul is spot on. As you need to pick a different pool based on uri, you will need different statements for different uri, so that you can pick different pools. Maybe you can simplify it by moving the uri modification part of out of statement
when HTTP_REQUEST {
set x [string tolower [HTTP::uri]]
HTTP::uri [string map {"/*/" "/"} [HTTP::uri]]
switch -glob x {
"/css*" {
pool css
}
"/apps*" {
pool apps
}
"/containers*" {
pool containers
}
}
}
----------
`
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