2 actions in the same rule: redirect + load balance
Hi all,
I need to make an iRule whose behaviour is:
1.- When the web starts with "/a/b" redirect to "/b" AND balance to the pool POOL_x.x.x.x_8090 2.- When the web starts with "/a/" redirect to "/" AND balance to the pool POOL x.x.x.x_8090
I managed to do it with 2 irules:
First: redirect
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/a/b" } { HTTP::redirect "http://[HTTP::host]/b" } elseif { [HTTP::uri] starts_with "/a" } { HTTP::redirect "http://[HTTP::host]/" } }
Second: Balance
when HTTP_REQUEST { set myURL [HTTP::uri] if { $myURL starts_with "/" } { pool POOL_x.x.x.x_8090 } elseif { $myURL starts_with "/b } { pool POOL_x.x.x.x_8090 } }
But I must consolidate in the same iRule,
Any ideas?
Regards