Forum Discussion
Dec 21, 2006
Wow, that's a long iRule...
Here's a start of the first part to get you going. You should be able to figure out how to convert the rest from this...
I stored some common values (host, user-agent, and uri) in local lower case variables to avoid multiple comparisons in some places just to account for case sensitivity.
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set ua [string tolower [HTTP::header "User-Agent"]]
set uri [HTTP::uri]
if { ($host contains "demo.nature.com") ||
($host contains "deutsche.nature.com") ||
($host contains "mailart.nature.com") ||
($host contains "fastart.nature.com") } {
pool nature
} elseif { ($ua contains "google") || ($ua contains "ask") || ($ua contains "msn") } {
pool spider_pool
} elseif { $host contains "isn-online.org" } {
if { ($uri equals "/") || ($uri equals "/index.html" } {
HTTP::redirect "http://www.nature.com/isn"
} else {
pool Java
}
} elseif { $host contains "www.palgrave-journals.com" } {
if { ($uri equals "/") || ($uri equals "/index.html" } {
HTTP::redirect "http://www.palgrave-journals.com/pal"
} elseif { $uri equals "/mysiteaccount" } {
HTTP::redirect "http://www.palgrave-journals.com/nams/svc/mysiteaccount"
} elseif { ($uri starts_with "/cgi-bin") ||
($uri starts_with "/services/link.taf") ||
($uri equals "/login/login.taf") } {
use pool nature
} ...
} ...
}
Good luck and let us know if you get stuck...
-Joe