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
}
}
I’m not really sure on what your RewriteRule does as I don’t have much exposure with mod_rewrite. If the iRules didn’t work, pls let us know what your RewriteRule does.
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?
}
}
}