Forum Discussion
Nandhi
Cirrus
Feb 28, 2023irule not closed with else { }
If the irule statement not ended with else { ] contains multiple ifelse. What will be the result. Whether loop can occur or it just skip the irule if no conditions matched?
Paulius
MVP
Feb 28, 2023Nandhi I believe you mean that if the following is configured what will happen. Please note that this only has an if without an else following it.
if { [HTTP::host] == "example.com" }{
HTTP::redirect "http://www.example.com/"
}
If the rule mentioned was in place traffic would continue on unless of course it matched the exact string of "example.com" but if it didn't it would be directed to whatever default action the VS has configured such as a pool that would receive traffic from the VS. Typically the else statement is used to force a specific behavior if your traffic does not match the if statement.
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