Need help making Irule more efficient
Below is a sample of what is running. Each country/culture has two seperate if statements because we don't want to disrupt flow to other items in those folders. We are in the middle of switching from our old CMS to a new one and need to keep parts of both CMSes alive for now so we are usign iRules to route for 20 different country home pages on 3 different server pools. We have mostly used "equals" but there are one of two instances of "contains" mixed in.
Any advice on how to improve the structure and perfomance would be appreciated.
FYI I am a Sys Admin not a programmer.
Thanks in advance.
John
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/" }{
HTTP::redirect "http://mysite.com/home/"
}
if { [string tolower [HTTP::uri]] equals "/gb/eng/default.asp" }{
HTTP::redirect "http://[HTTP::host]/home/en-gb/"
}
if { [string tolower [HTTP::uri]] equals "/gb/eng/" }{
HTTP::redirect "http://[HTTP::host]/home/en-gb/"
}
if { [string tolower [HTTP::uri]] equals "/fr/fra/default.asp" }{
HTTP::redirect "http://[HTTP::host]/home/fr-fr/"
}
if { [string tolower [HTTP::uri]] equals "/fr/fra/" }{
HTTP::redirect "http://[HTTP::host]/home/fr-fr/"
}
if { [string tolower [HTTP::uri]] contains "/home/admin-tools/" }{
HTTP::redirect "http://[HTTP::host]/home/"
}
}