Forum Discussion
jonathanw84
Cirrus
Aug 23, 2021iRule to Shift Entire URL Path to Lower Case
I have the following iRule in place for one of our virtual servers. Everything is working well, except some requests to the backend servers are case sensitive and need the entire path to be lowercase...
spalande
Nacreous
Aug 26, 2021Hi,
Since you need to send some requests to backend as case-sensitive, you don't need to use a rediect but a rewrite funtion instead.
Please try below iRule. Selectively add the uri which needs to be send in lowercase to backend and update iRule accordingly. I would suggest you can create new iRule and attach to the VIP. From logging, you can see if the required uri has been converted to lowercase and disable it afterwards.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/cdn/img/test.png*" -
"/cdn/img/example.png*"
log local0. "original_uri: [HTTP::uri]"
{
set new_uri "[string tolower [HTTP::uri]]"
log local0. "new_uri: $new_uri"
HTTP::uri $new_uri
} default {
return
}
}
}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
