Forum Discussion
rob_miller_7792
Nimbostratus
Nov 01, 2007Nested iR not working?
I am trying to implement a nested iRule, and was hoping to get some help on my syntax.
I am trying to accomplish 2 things. First, if the user enters mydomain.com or x.mydomain.com then I ne...
hoolio
Cirrostratus
Nov 02, 2007The rule logic looks correct. Can you add a few log statements to see what's happening? I think something like this should work:
log "New request for " + http_host
if (http_host contains one of ValidDomains){
log "Request matched class ValidDomains"
log "substr: " + substr(http_uri, 1, '?')
if (substr(http_uri, 1, '?') contains one of SecurePages) {
log "redirecting to https://" + http_host + "/" + http_uri
redirect to "https://%h/%u"
}
else {
log "Client requested non-secure page, sending to pool"
use pool mywebfarm
}
}
else {
log "Client requested invalid host. Redirecting to: http://www.mydomain.com/" + http_uri"
redirect to "http://www.mydomain.com/%u"
}Aaron
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
