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" } {
...
Brad_Parker
Cirrus
Sep 01, 2015Updated and tested in my lab, this could work for you.
when HTTP_REQUEST {
set uri "/[getfield [HTTP::uri] "/" 2]/"
HTTP::uri [string map " $uri / " [HTTP::uri]]
}
It will remove the first folder in the URI path.
paulfish
Nimbostratus
Sep 02, 2015Thanks everyone, very much appreciated
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