Forum Discussion

Mike_Graston_10's avatar
Mike_Graston_10
Icon for Nimbostratus rankNimbostratus
Oct 18, 2006

Case sensitivity

I have setup a rule to redirect based on a uri string in the request. I also had to add them in both Upper and lower case. I know there is a way to set this up to shorten the Irule and Have tried adding it several different ways. Some came up with error while trying to apply it like switches is invalid other just didn't work. I finally got this one to work but would like to know why i can't change it to lower case then redirect based on that.

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] contains "app2"} {

 

HTTP::redirect "https://website.com/app2/"

 

}

 

elseif { [HTTP::uri] contains "app1"} {

 

HTTP::redirect "https://website.com/app1/"

 

}

 

elseif { [HTTP::uri] contains "APP2"} {

 

HTTP::redirect "https://website.com/app2/"

 

}

 

elseif { [HTTP::uri] contains "APP1"} {

 

HTTP::redirect "https://website.com/app1/"

 

}

 

else {

 

pool www-website-com-http

 

}

 

}