Forum Discussion
hooleylist
Oct 01, 2008Cirrostratus
How about something like this:
when HTTP_REQUEST {
Check if host contains blah.com (case-insensitive)
if {[string tolower [HTTP::host]] contains "blah.com"}{
Redirect based on the requested URI (case-insensitive)
switch -glob [string tolower [HTTP::uri]] {
"*/folder01" {
HTTP::redirect "http://www.blah.com/folder01/default.aspx"
Exit HTTP_REQUEST in this rule
return
}
"*/folder02" {
HTTP::redirect "http://www.blah.com/folder01/default.aspx"
Exit HTTP_REQUEST in this rule
return
}
"*/folder03" {
HTTP::redirect "http://www.blah.com/folder01/default.aspx"
Exit HTTP_REQUEST in this rule
return
}
"*/folder04" {
HTTP::redirect "http://www.blah.com/folder01/default.aspx"
Exit HTTP_REQUEST in this rule
return
}
default {
HTTP::redirect "http://www.blah.com/default.aspx"
Exit HTTP_REQUEST in this rule
return
}
}
} elseif { [matchclass [string tolower [HTTP::host]] equals $::BLAH_Hosts] } {
pool BLAH_WEB
} else {
HTTP::redirect "http://www.blah.com/default.aspx"
}
}
If this doesn't work as you need it to, try adding log statements to track which code paths are running.
Aaron