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" } {
...
arpydays
Nimbostratus
Sep 01, 2015not quite sure I fully understand, is this the sort of thing you mean?
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/css*" {
HTTP::uri [string map {"/css/" "/"} [HTTP::uri]]
pool css
}
"/apps*" {
HTTP::uri [string map {"/apps/" "/"} [HTTP::uri]]
pool apps
}
"/containers*" {
HTTP::uri [string map {"/containers/" "/"} [HTTP::uri]]
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