Forum Discussion
Dmanden_23459
Nimbostratus
Oct 28, 2011Exclusion from Irule
Hey Guys
Hoping someone might be able to help me.
Ive been batteling with this iRule ofr a while now and I just cant seem to get it right.
I have a few virtual folders within a site that I need to redirect to HTTPS, I also need to exclude a specific folder beneath one of the VF's and then send it to a different location
some thing like below
www.google.com ( not the real site of course ) main site
www.google.com/test/* needs to be redirected to HTTPS
www.googel.com/test/unsecure/* needs to be excluded from the redirect sent to a seperate pool.
This is what ive come up with at the moment. Im not sure how close I am or not though
-----------------------------------------
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/test/unsecure" }
pool POOL-A }
if { ( [string tolower [HTTP::uri]] contains "/test/" and != "/test/unsecure" )
HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
else { pool POOL-default
}
}
------------------------------------------
If anybody could take a look and perhaps advise where I am going wrong it would be much appreciated
Regards
Dennis
- nitass
Employee
can you try this?when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/test/unsecure/*" { pool POOL-A } "/test/*" { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } default { pool POOL-default } } }
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