irule issue - URI Case
Dear Forum,
I have a strange issue that below mentioned irule works fine for converting all upper case letters in uri and hostname when http request is received but when https request with any upper case letter is initiated then uri or hostname remains same. I use ssl offloading for https requests. Any idea why it is behaving like this ?
when HTTP_REQUEST {
STREAM::disable
HTTP::uri "[string tolower [HTTP::path]]?[HTTP::query]"
if { [string tolower [HTTP::path]] equals "/" } { if { [HTTP::header "Accept-Language"] starts_with "fr" } { HTTP::respond 301 "Location" "https://www.mylocalnet.com/fr/pages/default.aspx"
} elseif { [string tolower [HTTP::path]] equals "/insidecontent/insidecontent.xml" } { HTTP::respond 301 "Location" "https://insidecontent.mylocalnet.com/insidecontent/insidecontent.xml"
} elseif { [HTTP::path] contains "/hr-dept/" } { HTTP::respond 301 noserver Location "https://[HTTP::host][string map -nocase {hr-dept hr-depart} [HTTP::path]]" } }
when HTTP_RESPONSE {
if { [HTTP::header exists Location] } { HTTP::header replace Location [string map {"http://" "https://"} [string tolower [HTTP::header Location]]] }
if { [HTTP::header Content-Type] contains "text" } {
STREAM::expression { @ @preprod.ccaduae.ae@ @ }
STREAM::enable }
}