if i want to use mre mobile types will below iRule worksno, syntax is not correct. you should use "switch" or "class match" with data group.
this is an example of class match with data group.
[root@ve10:Active] config b class mobile_class list
class mobile_class {
{
"android"
"iphone"
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] equals "home.example.co.in" } {
if { [URI::query "?&[HTTP::query]" main] equals "true" } {
return
}
if { [class match -- [string tolower [HTTP::header "User-Agent"]] contains mobile_class] } {
HTTP::redirect "https://lite.example.co.in"
}
} elseif { [URI::query "?&[HTTP::query]" main] equals "true" } {
HTTP::redirect "https://home.example.co.in?main=true"
}
}
}