Forum Discussion
Dafydd__Rhys-Jo
Mar 27, 2006Historic F5 Account
Redirect iRule 4.2
if (http_uri matches_regex "/manager/protected") {
redirect to "https://%h/%u"
}
else {
use ( appgen_216.152.109.110.80 )
}
I am trying to get thi...
hoolio
Cirrostratus
Apr 03, 2006If you are performing a match against the URI as in the sample you provided, you would only want to specify the path and/or object name, not the protocol or host.
[protocol://subdomain.domain.tld/path/to/object.ext]
Like this:
if (http_uri matches_regex "/manager/protected") {
...
}
Not:
if (http_uri matches_regex "http://subdomain.domain.tld/manager/protected") {
...
}
However, you don't need to use matches_regex unless you need to use a regular expression for the comparison. I would imagine, using starts_with or contains should work fine with less overhead.
Are you still seeing the looping? If so, make sure you are using this general flow:
proxy [external IP address]:443 -> VIP [127.x.y.z]:80 -> pool
VIP: [external IP address]:80 -> rule to redirect to https
Beyond this, I would recommend working with Support, as the iRule looks fine.
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
