Forum Discussion
Ankur_5273
Nimbostratus
Aug 11, 2014Convert HTTP Redirect to case sensitive
Hi Experts,
Kindly help in converting the below highlighted part in case sensitive format
when HTTP_REQUEST {
if { [HTTP::host] ne "www.myweb.com" } {
return
}
switch -glob [HTTP::pat...
Cory_50405
Noctilucent
Aug 12, 2014The code snippet I posted above should work. Your check against lower case 'report' is what was failing. By first converting the string to lowercase and then matching against that, you'll ensure case sensitivity isn't an issue. So here's your whole iRule:
when HTTP_REQUEST {
if { [HTTP::host] ne "www.myweb.com" } {
return
}
switch -glob [string tolower [HTTP::path]] {
"/secureapp/connect/report_en/rep/*" {
**HTTP::redirect "**http://www.myweb.com[string map {/secureapp/connect/REPORT_en/REP/ /en/} [HTTP::uri]]"****
}
"/en/*" {
**HTTP::uri [string map {/en/ /secureapp/connect/REPORT_en/REP/} [HTTP::uri]]**
}
default {
do nothing
}
}
}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