Joe_Pipitone
Jul 29, 2010Nimbostratus
[SOLVED] iRule redirect loop problem
I have an iRule which is only partially working. Can anyone tell me why putting the following in place results in a redirect loop? It does the job partially by stripping the www, however if you try to browse to oursite.com/salarysurvey or oursite.com/salarysurveys it results in a redirect loop.
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.oursite.com") } {
HTTP::redirect "http://oursite.com[HTTP::uri]"
return
}
switch -glob [string tolower [HTTP::uri]] {
"/salarysurvey" -
"/salarysurvey/" {
HTTP::redirect "http://oursite.com/salarysurveys/"
return
}
"/salarysurveys" -
"/salarysurveys/" {
HTTP::redirect "http://oursite.com/salarysurveys/"
return
}
"/images*" {
HTTP::redirect "http://legacy.oursite.com[HTTP::uri]"
return
}
}
}