Forum Discussion
Gary_Bristol_19
Nimbostratus
Jul 29, 2015need to check for a path in an irule
i need to check for a path in an irule
if it isn't there send it to one re-direct if it is, send it to a different re-direct
when HTTP_REQUEST {
set lhost [string tolower [HTTP::host]]
se...
VernonWells
Employee
Jul 29, 2015Is your code not working for you? I will say that it can be somewhat simplified, since your outside if/else conditionals check the same condition and the inner [if]s are negations of one another:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "itservices.ou.edu" } {
if { [string tolower [HTTP::path]] starts_with "/norman" } {
HTTP::redirect "https://ouitservices.service-now.com/ess_portal"
} else {
HTTP::redirect "http://itscnorman.ou.edu"
}
}
}
If you are running at least version 11.4, you should be able to accomplish this with a Local Traffic Policy, as well:
A Local Traffic Policy should, in general, be more performant, and is integrated with the web UI and CLI.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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