Joe_Pipitone
May 12, 2010Nimbostratus
Redirects / rewrites conflicting
I have a master iRule which seems to be throwing a "Multiple redirect/respond invocations now allowed"
The iRule is as follows. It tries to match certain urls typed in by the user, and redirects. Another part of the rule simply says if the uri begins with images, then rewrite to legacy.oursite.com/images. The 3rd part of the iRule strips the www from the domain.
The errors I am getting are:
TCL error: redmond_redirects HTTP_REQUEST -
Operation not supported. Multiple redirect/respond
invocations not allowed line 1 invoked from within
HTTP::redirect http://oursite.com[HTTP::uri] default arm line 1
invoked from within switch -glob [HTTP::uri] { / {
HTTP::redirect http://oursite.com } default { HTTP::redirect
http://oursite.com...
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "/survey" or [string tolower [HTTP::uri]] equals "/survey/" } {
HTTP::redirect "http://oursite.com/surveys/"
}
if { [string tolower [HTTP::uri]] equals "/surveys" } {
HTTP::redirect "http://oursite.com/newsurveys/"
}
if { [string tolower [HTTP::uri]] equals "/anotherurl/survey2008" or [string tolower [HTTP::uri]] equals "/anotherurl/survey2008/" } {
HTTP::redirect "http://oursite.com/whitepapers/2009/05/survey.aspx"
}
if { [string tolower [HTTP::uri]] starts_with "/anotherurl/survey2007" or [string tolower [HTTP::uri]] equals "/anotherurl/survey2008/" } {
HTTP::redirect "http://oursite.com/whitepapers/2009/05/2007survey.aspx"
}
if { [string tolower [HTTP::uri]] equals "/subscribe" or [string tolower [HTTP::uri]] equals "/subscribe/" } {
HTTP::redirect "https://some.domain.com/sub/MI?WP=PCODE"
}
set my_uri [string tolower [HTTP::uri]]
if { $my_uri starts_with "/images" } {
redirect to oursite.com/images on matching URI
HTTP::redirect http://legacy.oursite.com$my_uri
}
if { ([HTTP::host] eq "www.oursite.com") } {
switch -glob [HTTP::uri] {
"/" { HTTP::redirect "http://oursite.com" }
default { HTTP::redirect "http://oursite.com[HTTP::uri]" }
}
}
}
Can anyone help me resolve these errors?