Forum Discussion
Martijn_Dekkers
Nimbostratus
Jun 15, 2006Matching wildcards in URI
Hi all, I'm new to iRules and could use some help.
I am trying to redirect to https if certain portions of the uri match - a sample uri would be http://testserv/test/folder1/folder2/id=1234 ...
JRahm
Admin
Jun 15, 2006In the case you will have multiple id=xxxx, I'd build a class:
class allowed_ID {
"1234"
"4567"
"8901"
}Then reference the ID first, but redirect only if the URI begins with /test:
when HTTP_REQUEST {
if { [matchclass [HTTP::uri] contains "$::allowed_ID"] } {
if { [HTTP::uri] starts_with "/test" } {
HTTP::redirect https://your.host.here
}
}
}Might check the syntax on my matchclass against other posts in the forum, I haven't personally used it before.
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
