You could do it that way. The [HTTP::host] vaule of a URL isn't case sensitive only the [HTTP::uri] or [HTTP::path] is and that depends on the Operating System hosting the website.
I this way is alittle cleaner and easier to read:
when HTTP_REQUEST {
switch -glob [HTTP::host] {
"www.website1.com" { HTTP::respond 301 Location "http://www.google.com" }
"www.website2.com" { HTTP::redirect "http://www.yahoo.com" }
"www.website3.com" { pool website3pool }
}
}
HTTP::respond allows you to specify the HTTP Status Code to a 301 (Permanent)
HTTP::redirect gives a default 302 (Temporary) Redirect
or you can route the traffic to a specific pool.
Hope this helps.