dpeterson_24304
Sep 15, 2011Nimbostratus
Syntax errors on match_glob?
I've got a remarkably boring rule that I'm getting a syntax error on, and I don't understand why. I've also tried string_match and am getting similar errors, but I'm just not seeing what I'm doing wrong:
On https calls, detect no www and redirect to www
when HTTP_REQUEST {
if { [HTTP::host] matches_glob "blah*.com" } {
HTTP::redirect "https://www.[HTTP::host][HTTP::uri]"
}
}
I get this:
01070151:3: Rule [BLAH_HTTPS_NO_WWW] error:
line 3: [parse error: PARSE syntax 91 {syntax error in expression " [HTTP::host] matches_glob "blah*.com" ": extra tokens at end of expression}] [{ [HTTP::host] matches_glob "blah*.com" }]
Basically I'm just trying to redirect a number of numbered domains (say blah1.com - blah10.com) to www.blah1.com without writing rules for each one.
Any thoughts?