Forum Discussion
C_D_18583
Nimbostratus
Aug 04, 2005IRule and Error Checking
Please See comments below
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/channel/" } {
pool QA1
}
elseif {[HTTP::uri] starts_with "/performance/" } {
pool ...
unRuleY_95363
Aug 05, 2005Historic F5 Account
This is caused by something called operator precedence. The "not" operator (an alias for "!") is of higher precendence than starts_with, ends_with or equals. So, what's happening is that the not is being applied to the [HTTP::uri] operand and then the result of that is being checked whether it ends_with "/". Clearly not what you want.
Try adding some parenthesis to tell Tcl want should happen first:
elseif { not ( [HTTP::uri] ends_with "/" ) } {
HTTP::redirect "https://[HTTP::host][HTTP::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