smp_86112
Jun 21, 2010Cirrostratus
switch statement conditions
Is there a way to configure switch to handle different "conditions"? For example, I want to take one action if [HTTP::uri] equals one string, but a different action if it starts_with another? Schematically, something I'm looking to do something like this:
when HTTP_REQUEST {
switch [HTTP::uri] {
equals "/" { [HTTP::redirect] http://www.myapp.com/somewhere_else }
starts_with "/custom" { [HTTP::uri] "/new" }
}
}
So I'd like a single switch statement look at a string pattern, but take different actions based on the value of different operators.