By the way, if you are using at least 11.4, you may consider using Local Traffic Policies for this:
If you are using a version before 11.4, Traffic Classes can be used:
An example of a Local Traffic Policy to direct queries for www.abc.com to pool1 and www.xyz.com to pool2:
ltm policy policy-hostname-redirect {
controls { forwarding }
requires { http }
rules {
www.abc.com {
actions {
0 {
forward
select
pool pool01
}
}
conditions {
0 {
http-host
values { www.abc.com }
}
}
ordinal 1
}
www.xyz.com {
actions {
0 {
forward
select
pool pool02
}
}
conditions {
0 {
http-host
values { www.xyz.com }
}
}
ordinal 2
}
}
strategy first-match
}
Naturally, this can be done via the Web UI, as well.