iRule- Operation not supported. Multiple redirect/respond invocations not allowed
Hello community,
I'm by know means a Tcl expert and I normally only handle generic type of scripts. I've searched around regarding the error in the subject and I've adjusted the script to the best of my ability at this point.
Can someone be kind enough to look at the below code and tell me if something jumps out at them that looks incorrect? Also, in regards to the invoke incrementing does it start at 0 and go to 1 for each elsif or does it keep incrementing, for example, 1, 2, 3, 4?
Thanks in advance,
Bill
when HTTP_REQUEST {
set uri [HTTP::uri] set invoke 0 if {([string tolower [HTTP::path]] contains "/connect/beachbody-challenge/pledge") } { incr invoke regsub "/connect/beachbody-challenge/pledge" $uri "/beachbody-challenge/participate-commit-now" uri
} elseif {([string tolower [HTTP::path]] contains "/connect/beachbody-challenge/entry") } { incr invoke regsub "/connect/beachbody-challenge/entry" $uri "/beachbody-challenge/enter-contest" uri
} elseif {([string tolower [HTTP::path]] contains "/connect/beachbody-challenge/winners-monthly") } { incr invoke regsub "/connect/beachbody-challenge/winners-monthly" $uri "/beachbody-challenge/contest-info-and-contest-winners" uri
} elseif {([string tolower [HTTP::path]] contains "/connect/beachbody-challenge/winners-quarterly") } { incr invoke regsub "/connect/beachbody-challenge/winners-quarterly" $uri "/beachbody-challenge/contest-info-and-contest-winners" uri
} elseif {([string tolower [HTTP::path]] contains "/connect/beachbody-challenge/winners-final") } { incr invoke regsub "/connect/beachbody-challenge/winners-final" $uri "/beachbody-challenge/contest-info-and-contest-winners" uri
} elseif {([string tolower [HTTP::path]] contains "/connect/beachbody-challenge/vote/quarterly") } { incr invoke regsub "/connect/beachbody-challenge/vote/quarterly" $uri "/beachbody-challenge/vote/quarterly" uri
} elseif {([string tolower [HTTP::path]] contains "/connect/beachbody-challenge") } { incr invoke regsub "/connect/beachbody-challenge" $uri "/beachbody-challenge" uri }
if {($invoke == 1)} {
HTTP::respond 301 Location https://[HTTP::host]$uri
}
}