Forum Discussion
Valentine_96813
Nimbostratus
Dec 14, 2012Redirect on client IP and uri
I have a request to redirect a session if certain IP comes in and then only if it has a keyword in the URI and then setting persistence. SO basically combining:
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr]/8 equals 10.0.0.0] }
with
when HTTP_REQUEST {
if { [HTTP::path] starts_with "/tulip/" }{
persist cookie
}
else {
persist source_addr
}
}
Can this be combined with && in the middle? I am trying to run this through the editor and its not working. Could use a little help.
4 Replies
- What_Lies_Bene1
Cirrostratus
You can only combine them in the HTTP event;when HTTP_REQUEST { if { (([HTTP::path] starts_with "/tulip/") && ([IP::addr [IP::client_addr] equals 10.0.0.0/8])) } { persist cookie } else { persist source_addr } } - What_Lies_Bene1
Cirrostratus
Note the '&&' should just be '&&', the forum software just mangles them for some reason. - Valentine_96813
Nimbostratus
Thanks for this. I will setup to rey this soon. Coudn't see the forest through the trees this morning.
- What_Lies_Bene1
Cirrostratus
You're welcome, I've been there;-) Post back to let us know how you get on. Cheers
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