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]
...
hoolio
Cirrostratus
Nov 13, 2008You 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?
}
}
}
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
