iRule 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 [HTTP::uri] starts_with “/MyTest” } { pool pool_mytest.com--VIP247.100.TCP.443 } else { HTTP::redirect “https://test.xxx.com/MyTest/[HTTP::URI]” }

}

So what I need to do is, when anything called mytest comes in and in any format ie, mytest Mytest, mYtest, etc. I need to switch it to MyTest. Is that possible?

Thanks for any help in advance.

Matt

Try 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.