Forum Discussion
Kyle_S
Apr 20, 2015Nimbostratus
String tolower within a switch -glob
We are routing traffic to various Pools by their URI. Our developers are implementing a change to the name of the of the incoming URI and need it to point to the existing Virtual Directory on the ser...
Kyle_S
Apr 20, 2015Nimbostratus
Thanks nitass, that did it. This is what I have in place, in case anyone else needs it as a reference:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/vd/service/*" {
HTTP::uri [string map -nocase {"/VD/service/" "/change1/"} [HTTP::uri]]
pool Pool_service}
"/vd/forms/*" {
HTTP::uri [string map -nocase {"/VD/Forms/" "/change2/"} [HTTP::uri]]
pool Pool_forms}
"/vd/orders/*" {
HTTP::uri [string map -nocase {"/VD/Orders/" "/change3/"} [HTTP::uri]]
pool Pool_orders}
"/vd/contact/*" {
HTTP::uri [string map -nocase {"/VD/Contact/" "/change4/"} [HTTP::uri]]
pool Pool_contact}
default {
discard
}
}
}
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