Forum Discussion
benbenben_9082
Feb 18, 2008Nimbostratus
Advice on matching URI's
Hi,
I am using an F5 for quite a large website. I need to direct visitors to certain pages over SSL (I terminate SSL on the F5) and bounce them back to normal HTTP when they leave that particular area.
Currently, I'm using an irule like:
if {[matchclass [HTTP::uri] contains $::Make_SSL]} {
This works fine however it is rather loose and matches things it shouldn't. e.g. 'administrator' gets caught by 'admin' and so on.
I could break this up so I use 'contains/starts_with/ends_with' which still isn't perfect. I've been looking at using regular expressions, however I've read a few articles which say this should be avoided at all costs. I am however wondering if it would be the best solution as opposed to an irule which does 3 checks for 'contains/starts/ends' and checks the necessary data group.
With the 'contains/starts/ends' check there would be 28 items in the data groups, so potentially thats 84 checks on one request. With regex's I could get this down to 15 expressions.
I'd be interested in hearing your thoughts.
Thanks - Ben
- Nicolas_MenantEmployeeHi,
- benbenben_9082NimbostratusThanks - I think that link to performance testing will be really useful.
- The_BhattmanNimbostratusHow about using SWITCH?
- benbenben_9082NimbostratusOK, looking into SWITCH, is there anything still to be gained from this as I would like all the regular expressions in a data group list which might mean I have to use matches_regex ?
- Nicolas_MenantEmployeeUsually we recommend to use SWITCH when you have less than 100 entries and data group for higher number.
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