Peak_10_71174
Dec 02, 2009Nimbostratus
irule redirect verification
I have the need to add an irule that will redirect various https requests to a different url. Since I'm not very familiar with all the rules regarding syntax and order of these various requests, what I am wondering is if I need to put the least specific redirects last in the sequence, or if it matters.
For example, I need the following redirects:
1. companytest.abc.com/path1 to companypath1.abc.com/test
2. companytest.abc.com/path2 to companypath2.abc.com/test
3. companytest.abc.com to company.abc.com/test
Here is the sample irule I have create in order to do this, I was wondering if someone could verify that I have placed these in the correct order to account for no.3 being the least specific of all the redirects:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "companytest.abc.com" && [HTTP::uri] eq "/path1" } {
HTTP::redirect "companypath1.abc.com/test"
if { [string tolower [HTTP::host]] eq "companytest.abc.com" && [HTTP::uri] eq "/path2" } {
HTTP::redirect "companypath2.abc.com/test"
if { [string tolower [HTTP::host]] eq "companytest.abc.com"} {
HTTP::redirect "http://company.abc.com/test"
}
}
Let me know if you need more clarification. Thanks for any help in advance.