DM_5174
Nov 07, 2007Nimbostratus
Case-sensitive URL Redirection
Hello all,
I have created a 4x iRule that will redirect based on specific
words after the FQDN "http://%h/". So if i put "http://www.primarysite.com",
i get redirected to the main page, however if you enter "home" or "HOME" (lower case or upper case), it redirects you to the secondary site.
The quesion here is: Can I use RegEX, for example /[H][h][O][o][M][m][E][e]
in the code so to consolidate so i don't have to use two "if" statements?
By doing this, the user can put any of the combo upper or lower and still
get the same result, which is a redirection to "http://www.secondarysite.com/secure".
if (http_host == "www.primarysite.com" and http_uri == "/home") {
redirect to "www.secondarysite.com/secure/"
}
else {
if (http_host == "www.primarysite.com" and http_uri == "/HOME") {
redirect to "www.secondarysite.com/secure/"
}
else {
use pool APACHE_WEB_SERVERS
}
}
Thank you!