Forum Discussion
Albert__Tase_70
Nimbostratus
Apr 19, 2007need help with persistance and redirects
ok I have two vips which are 170.224.107.69_80 and 170.224.107.69_https
in the pool for 80 I have 10.245.243.19 on 80
and 10.254.243.27 on 80
under the vip for 443 I have the defaul...
Wes_98712
Nimbostratus
Apr 19, 2007First the URI match in the first line won't work because you are trying to match the URI to the entire URL. Something as follows should work:
when HTTP_REQUEST {
if { [HTTP::uri] contains "/BookStore/SecureCheckOut.do" } {
HTTP::redirect "https://170.224.107.69[HTTP::uri]"
} else {
pool bookstore_10.254.243.41_80
}
}As you can see on the redirect line I have set the URI variable, which would also contain any trailing query strings, if you don't want those then change the [HTTP::uri] to /BookStore/SecureCheckOut.do.
I would also suggest you store specific commands like [HTTP::uri] into a variable:
set my_uri [HTTP::uri], then you can do the following:
when HTTP_REQUEST {
set my_uri [HTTP::uri]
if { $my_uri contains "/BookStore/SecureCheckOut.do" } {
HTTP::redirect "https://170.224.107.69$my_uri"
} else {
pool bookstore_10.254.243.41_80
}
}It just looks a bit cleaner, plus you can reuse that variable anytime you want.
HTH
-Wes
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
