Forum Discussion
gr0x_33657
Nimbostratus
Nov 13, 2008Rewrite Rule
Im am currently using heicontech rewrite software to apply the following rule,
RewriteRule ^/(ca)-(eng|fre)/(card)/?$ /$2/store/redirect.cfm?sectionID=etc/gift/display.cfm=$3 [I,L]
I would like to use irule on the F5 but i am not sure how to.
Thank you
- hwidjaja_37598
Altostratus
can you try this out:when HTTP_REQUEST { if {[regsub {^/(ca)-(eng|fre)/(card)/} [HTTP::uri] \ {/\2/store/redirect.cfm?sectionID=etc/gift/display.cfm=\3} \ newUri]} { HTTP::redirect http://[HTTP::host]$newUri } }
- hoolio
Cirrostratus
You could also do this with string functions. The i flag is for case insensitive matching, so you could set the URI to lower case and then redirect based on the requested URI:when HTTP_REQUEST { Check the requested URI switch [string tolower [HTTP::uri]] { "/ca-eng/card" - "/ca-eng/card/" { Request was for eng HTTP::redirect "http://[HTTP::host]/eng/store/redirect.cfm?sectionID=etc/gift/display.cfm=card" } "/ca-fre/card" - "/ca-fre/card/" { Request was for fre HTTP::redirect "http://[HTTP::host]/fre/store/redirect.cfm?sectionID=etc/gift/display.cfm=card" } default { Take some default action? } } }
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