Forum Discussion
irules to redirect based on simple pay-per-click 'tags'
We have a pair of BIG-IP F5 Load Balancers, running 10x+, which direct traffic between two web farms.
Farm A) handles default traffic, 404s, etc
Farm B) handles a more limited set of CMS based pages
We have a request to support a PPC campaign, based on a limited set of URL characteristics,
along the lines of:
*RefID*
*TrkNum*
Some example URL's would resemble the following
http://www.domain1.com/filename?RefID=$string
http://www.domain2.com/path/filename?RefID=$string
http://www.domain3.com/path/to/filename?TrkNum=$string
The hope is that a *pattern* iRule can be created which will allow ANY request with *RefID* or *TrkNum* to be redirected from Webserver Farm A to Webserver Farm B.
Initially this doesn't look feasible however, as the iRule logic apparently will only use a single wildcard, making *pattern* type wildcard matching not possible.
Can anyone confirm, or point to other options ?
regards,
- hoolio
Cirrostratus
You can check the URI in the request using [HTTP::uri] and use switch to handle multiple patterns:when HTTP_REQUEST { switch -glob [HTTP::uri] { "*RefID*" - "*TrkNum*" { Matched RefID or TrkNum } default { No match } } }
- hoolio
Cirrostratus
Also, if the strings you want to check for are in the query string you could change [HTTP::uri] to [HTTP::query] to be more precise. - breddy_11660
Nimbostratus
That's good to hear. I was informed by our datacenter that *wildcard*-pattern-*wildcard* type iRules were just not possible, since only the first wildcard would be read. - hoolio
Cirrostratus
switch -glob uses the same matching logic as TCL string match so you can definitely use multiple wildcards and character classes: - breddy_11660
Nimbostratus
That worked, by the way. Have successfully enabled the listed rules, and PPC links are working correctly now.
Recent Discussions
Related Content
* 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