DM_5174
Nov 09, 2007Nimbostratus
case-sensitive URL redirection - Code conversion
Hi all,
I have created the iRule below with the help of users on this forum in version 4.x, however we also have LBs with version 9.x. Please help me in converting this to version 9.x?
Basically when a someone connects using the URL "http://www.primarysite.com" they get routed to the main page, however, when they enter "home" after the FQDN, they need to get routed to "https://www.secondarysite.com/secure". The "home" needs to be case-insensitive, where it does not matter if they enter it in upper or lower case letters or even a combo, i.e. "hOmE", the result should be that they get routed to "https://www.secondarysite.com/secure/".
if (http_host == "www.primarysite.com" and http_uri matches_regex "/[hH][oO][mM][eE]")
{
redirect to "https://www.secondarysite.com/secure/"
}
else {
use pool APACHE_WEB_SERVERS
}
Thanks all!