That's because the iRule is comparing the string "/join/events" and you passed in "/join/events/".
Something like this should work
when HTTP_REQUEST {
if { [HTTP::uri] equals "/join/events/" } {
HTTP::uri "/join"
}
}
But, that would ONLY match a url of "/join/events/". "/join/events", "/Join/Events/", etc would not match.
You could also use a "starts_with" to compare like this
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/join/events" } {
HTTP::uri "/join"
}
}
That would match "/join/events" and "/join/events/" but it would also match on "/join/eventsFOOBAR" or anything else after events in the URI.
If you want to have more options in your comparisons, I'd use a switch statement with the "string tolower" on the URI.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/join/events" -
"/join/events/" {
HTTP::uri "/join"
}
}
}
Lots of options, it really depends on your app logic how complex you want to go with the comparison.
-Joe