Forum Discussion
iRule- Need syntax help
The correct syntax is:
when HTTP_REQUEST {
if { [HTTP::path] starts_with "/PasswordVault/auth/rsa" } {
HTTP::respond 301 Location "/"
}
The missing part is the substitution operator (the square brackets) enclosing HTTP::path. Generally, when you want a command to retrieve a value that you will use, you enclose the command in the square brackets. Contrast, in your code, HTTP::path with HTTP::respond. With the former, you want the value (to use as the left operand of the starts_with operator). With the latter, you want the command to take an action, but do not need to capture the result (because there isn't one).
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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