Forum Discussion
dan_6764
Nimbostratus
Jul 31, 2009irule operators
Hi i wonder if someone can help me...
I have a set up where if someone access a HTTPS site and i want to redirect to HTTP on certain conditions.
Condition :
user is trying to access a URI that does not match a certain value
so accessing https:;/mydomain.com/secure/secure.html
you would get through on https
however if you came in to the vip on :https::/mydomain.com/notsecure/secure.html you get redirected to HTTP
here is my rule so far.. I just can't find the logic to say " does not contain "
when HTTP_REQUEST {
log local0. [HTTP::uri]
if { [HTTP::uri] contains "/secure/"} {
HTTP::redirect "http://[HTTP::host][HTTP::uri]"
}
}
can anyone help ??
thanks
dan
3 Replies
- hoolio
Cirrostratus
Hi Dan,
You can use ! or not for a logical not. It's easiest to wrap whatever you're NOT'ing in parentheses:
if { not ([HTTP::uri] contains "/secure/")}{
Aaron - dan_6764
Nimbostratus
many thanks!
Dan - hoolio
Cirrostratus
You can also check the following pages for getting started with iRules and TCL
iRules Overview
http://devcentral.f5.com/Default.aspx?tabid=75&nfpg457=2
Tcl Reference Manual: Contents
http://tmml.sourceforge.net/doc/tcl/index.html
Aaron
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