I know I am so close to getting this work, and it’s so simple…
I need a simple rewrite rule that is activated on certain conditions, I was hoping to use “||” to accomplish this, but I get an error that says :“command is not valid in the current scope” with my existing rule, any thoughts?
when HTTP_REQUEST {
if { ([HTTP:uri] starts_with “/path/to/broken”) ||
([HTTP:uri] starts_with “/other/path/broken”)
} {
HTTP::redirect “maintenance.html” Note: Modified URL for forum posting.
when HTTP_REQUEST {
if { ([HTTP::uri] starts_with "/path/to/broken") || ([HTTP::uri] starts_with "/other/path/broken") } {
HTTP::redirect "maintenance.html"
Note: Modified URL for forum posting.
}
}
You had a few errors.
I would suggest using the iRule Editor. It will help you with syntax and command options. It is a free tool and is available to download off of the main DevCentral Homepage.
Awesome, thanks for the tip, I will use that for now on.
In the end, as these URI will change…I found a datagroup was a much more simple option for my needs, so didn’t end up using the OR operator after all. Thanks for your help!