Hi User1115,
In that case one of the ways you can do this is the following codes
This is for version 9.x.x
when HTTP_REQUEST {
Insert cookie if it matches the CLASS_IP datagroup
if { [matchclass [IP::client_addr] eq $::class_ip] } {
HTTP::cookie insert name "class" value "class"
}
Choose a pool based on URI
if { [HTTP:uri] starts_with "/clasee*"} {
pool class
} else {
pool main
}
}
OR Using a switch statement
when HTTP_REQUEST {
Insert cookie if it matches the CLASS_IP datagroup
if { [matchclass [IP::client_addr] eq $::class_ip] } {
HTTP::cookie insert name "class" value "class"
}
Choose a pool based on URI
switch -glob [string tolower [HTTP::uri]] {
"/clasee*" { pool class }
default { pool main }
}
}
If you are going to v10 then the code would like like the following
when HTTP_REQUEST {
Insert cookie if it matches the CLASS_IP datagroup
if { [class match [IP::client_addr] equals "class_ip" } {
HTTP::cookie insert name "class" value "class"
}
Choose a pool based on URI
if { [HTTP:uri] starts_with "/clasee*"} {
pool class
} else {
pool main
}
}
OR Using a switch statement for v10
when HTTP_REQUEST {
Insert cookie if it matches the CLASS_IP datagroup
if { [class match [IP::client_addr] equals "class_ip"] } {
HTTP::cookie insert name "class" value "class"
}
Choose a pool based on URI
switch -glob [string tolower [HTTP::uri]] {
"/clasee*" { pool class }
default { pool main }
}
}
I hope this helps
Bhattman