Forum Discussion
pmaubo2_55685
Oct 10, 2012Nimbostratus
I confirmed "starts_with" in my irule calling a uri from a data class was working if any other characters were added, it just did not work correctly and/or broke with no redirect. Why? I really am at a loss. "Contains" also does not work, so it must be the nature of how the irule was written. Below is the key ingrediants so anyone can spot something, have at it.
when HTTP_REQUEST {
set my_uri [string trimright [HTTP::uri] "/" ]
Determine if you are trying to go to a site that has a vanity URL
if {[class match [string tolower [HTTP::uri]] contains www_vanity_url_redirection]}{
set vanity_path [class search -value www_vanity_url_redirection starts_with [string tolower [HTTP::uri]]]
HTTP::redirect $vanity_path
} else {
Do nothing
unset set my_uri
}
}