Forum Discussion
Phil_102636
Nimbostratus
Oct 05, 2012need help to get uri to work regardless of any extra characters
I have an irule that uses a data class to look for a keyword and if found redirects to another URL.
This part works fine but if for some reason any extra characters are put into the URL it fails...
pmaubo2_55685
Nimbostratus
Oct 10, 2012I 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
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
