Hi,
Maybe I did not understood well, but, as you mentioned "multiple headers", have you a list of header names or you intend to look at any of them?
I think I would do like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/news*" -
"/weather*" {
foreach name [list MyHeader1 MyHeader2 MyHeaderN] {
switch -glob [string tolower [HTTP::header $name]] {
"*www.yahoo.com*" {
HTTP::redirect "https://www.yahoo.com/login.aspx=0"
return
}
"*www.google.com*" {
HTTP::redirect "https://www.google.com/login.aspx=0"
return
}
}
}
}
}
}
or this for any header names:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/news*" -
"/weather*" {
foreach name [HTTP::header names] {
switch -glob [string tolower [HTTP::header $name]] {
"*www.yahoo.com*" {
HTTP::redirect "https://www.yahoo.com/login.aspx=0"
return
}
"*www.google.com*" {
HTTP::redirect "https://www.google.com/login.aspx=0"
return
}
}
}
}
}
}
I'm not sure if that was what you wanted, anyway, I hope it helps you in some way.