Forum Discussion
kalicut_48905
Nimbostratus
Feb 04, 2010HTTP class to redirect http to https
Hi,
Currently we have iRule that does http to https redirection for certain uri (like /app1/* & /app2/*). Can someone provide a simple example of how to do this using HTTP Class.
...
hoolio
Cirrostratus
Feb 15, 2010Hi Craig,
I think the HTTP class evaluation for Pattern Strings uses the TCL string match wildcard options (Click here). So you can use:
/uri => matches /uri
/uri* => starts_with /uri
*/uri => ends_with /uri
*/uri* => contains /uri
/uri[0-4] => match /uri0, /uri1, /uri2, /uri3, /uri4
/uri[a-d] => match /uria, /urib, /uric, /urid
/uri[aA][bB] => match /uria, /uriA, /urib, /uriB
/uri? => match /uri followed by any single character
The string patterns are case sensitive. So you could use character ranges [aA] to match both cases, or use a regex and the (?i) modifier to specify case-insensitivity.
https://support.f5.com/kb/en-us/products/big-ip_asm/manuals/product/bigipasm9_4/BIG_IP_9_4_ASM_Config_Gd-04-1.html
The traffic classifiers perform pattern matching using either literal strings or regular expressions. The literal strings can include wildcard characters, such as asterisk (*) or question mark (?). The regular expressions use the Tcl regular expression syntax. You can use a mixture of matching types within each traffic classifier.
I remember seeing a solution which covered this in good detail, but I couldn't find it on AskF5.
Aaron
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
