Forum Discussion
Deb_Allen_18
Jun 11, 2008Historic F5 Account
Good call on the switch case, CB. Doesn't look like you are making the pool selection in the case of the URI re-writing, is all - the switch is a case statement, and will drop out after executing the first match body.
Expanding on that idea a bit, and splitting up the 2 decisions that need to be made, I think this might be what you're after, Greg:
when HTTP_REQUEST {
first set the pool for any URI containing one of the subdirs
switch -glob [HTTP::uri] {
"*/train*" { pool train_pool }
"*/uatpr*" { pool uatpr_pool }
"*/uat*" { pool uat_pool }
}
now re-write the URI's when necessary
a "-" means to execute the same body as the next condition
The only diff betw the 2 strings is whether the leading '/" is needed
switch -glob [HTTP::uri] {
"*/train/" -
"*/uatpr/" -
"*/uat/" { HTTP::uri "[HTTP::uri]jsp/common/pgLogin.jsp" }
"*/uatpr" -
"*/train" -
"*/uat" { HTTP::uri "[HTTP::uri]/jsp/common/pgLogin.jsp" }
}
}
HTH
/deb