Forum Discussion
Steve_Sutton_87
Nimbostratus
Apr 29, 2005using matches_regex - strange error
Hi,
I've been trying to create a rule which will detect the user supplying a path with incorrect case and redirect using the correct case for the path. The rule is this:
if (http_uri == "/" or http_uri matches_regex "/[Ee][Pp][Mm]1/?") {
redirect to "https://%h/Epm1"
log "redirected blank URI"
}
else {
use pool main-qa-8080
}
The idea being that if they type /epm1, or /ePm1, or /EPM1/, etc., the will get redirected to the correct /Epm1. Now if I access the site with *any* path specified, I get a popup error message about redirection limit for the URL exceeded (full message attached).
Now, this isn't really critical, it was mostly an experiment to see if we could do this, but I'm hoping someone can clue me in as to why I'm getting the error - I've no clue, really, why I'm getting it.
Cheers,
Steve
2 Replies
Sort By
- Scott_Tennican_Historic F5 AccountThe problem is that your regular expression matches the correct uri as well as incorrect ones. So, you never stop redirecting.
if (http_uri == "/Epm1") { use pool main-qa-8080 } else ...
- Steve_Sutton_87
Nimbostratus
Ah ... well of course, that makes perfect sense. Thanks, gumby.
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