newf5learner_13
Mar 15, 2017Nimbostratus
irule for URI based redirection and to the pool..
Hi,
I'm looking for a short irule that helps in two ways.
- URI redirection
- Host based pool selection
I currently have two irules, I'm looking for one combined irule that serves the purpose.
Host to pool selection:
when HTTP_REQUEST {
switch -glob [ string tolower [HTTP::host]] {
"eng.page3.com" { pool page3_https_pool }
"eng.devpage3.pega.com" { pool devpage3_https_pool }
default { HTTP::respond 404 noserver }
}
URI based redirection:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/ClientService/BI-Integration/"} {
switch -glob [string tolower [HTTP::host]] {
"eng.page3.com" {HTTP::redirect "/clientapp[HTTP::uri]"}
}
}
}
Can someone help me with a irule that gives me the combined features of both. I don't like to use two separate irules on the same VIP, so checking if there is any better option.