Forum Discussion
Matthew_Hutchin
Nimbostratus
Jul 28, 2015iRule with Uppercase Letters in the URL
I am trying to force some letters in the URL to be uppercase. I have create the iRule but keep getting errors.
when HTTP_REQUEST {
if { [HTTP::host] equals "test.xxxx.com" and...
Kevin_Stewart
Employee
Jul 28, 2015Try this:
when HTTP_REQUEST {
if { ( [string tolower [HTTP::host]] equals "x.x.com" ) and ( [string tolower [HTTP::uri]] starts_with "/mytest" ) } {
if { not ( [HTTP::uri] starts_with "/MyTest" ) } {
HTTP::uri [string map -nocase {"/mytest" "/MyTest"} [HTTP::uri]]
}
} else {
HTTP::redirect "http://x.x.com/MyTest[HTTP::uri]"
}
}
Better to not do the pooling in the iRule if you can help it, as the status of the monitor status of the assigned pool directly affects the status of the VIP.
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