iRule redirects for HTTP::uri

Hi all

I wrote a irule for some simple HTTP redirect but found that a single / inserted by the user was casue the rule to break.

For example user tries to reach french.school.ca/students and I redirect to http:://www.school.ca/fr/student.

But if the user tries french.school.ca/students/ then the irule would not work.

when HTTP_REQUEST {

if { [HTTP::host] equals “francais.mcgill.ca” and [HTTP::uri] equals “/students” } {

HTTP::redirect “McGill University”

}

}

I tried the equals "/students/ as well, but that did not work.

Can anyone shed some light on the syntax I could use.

thanks

Chung

Have you tried replacing the “equals” operator with “starts_with”?

when HTTP_REQUEST {

if { [HTTP::host] equals “francais.mcgill.ca” and [HTTP::uri] starts_with “/students” } {

HTTP::redirect “McGill University”

}

}