Forum Discussion
Nicolas_Bellen1
Jun 03, 2011Nimbostratus
REGEX Alternatives
I've been trying to figure out how i'd structure a particular portion of my iRule to look for values contained in a string, instead of a regular expression but i'm having some difficulty:
Th...
hooleylist
Jun 03, 2011Cirrostratus
Hi Nick,
You can use string match to do the first part:
[string match {*DRC[0-9][0-9][0-9][0-9][0-9]*} [HTTP::uri]]
You could make the mastermenu and DRC checks more specific by using either HTTP::path or HTTP::query instead of HTTP::uri.
I tried the following, but couldn't quite figure out how to structure the first parameter of the string map to match on the host portion without using a regular expression.
Can you clarify this? Do you have multiple hosts that you're trying to rewrite in the redirect? Or do you want to rewrite all hosts to "def.example.com"? You can parse the host from the redirect location using URI::host:
http://devcentral.f5.com/wiki/default.aspx/iRules/URI__host.html
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