Forum Discussion
Joe_Pipitone
Nimbostratus
Mar 10, 2010iRule error in logs
The iRule below is throwing the following error in our logs. Can anyone help?
TCL error: our-rewrite HTTP_REQUEST - Operation not supported. Multiple redirect/respond invocations not allowed line 2 invoked from within HTTP::redirect http://sitename.org[HTTP::uri] default arm line 1 invoked from within switch -glob [HTTP::host] { / { HTTP::redirect http://sitename.org } default { HTTP::redirect http://sitename.org[HTTP::uri]...
Here's the iRule:
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.sitename.org") } {
switch -glob [HTTP::host] {
"/" { HTTP::redirect "http://sitename.org" }
default { HTTP::redirect "http://sitename.org[HTTP::uri]" }
}
}
}
3 Replies
- The_Bhattman
Nimbostratus
Hi Joe,
Not exactly why this would kick off an error message.
However, have you tried the followingwhen HTTP_REQUEST { if { ([HTTP::host] eq "www.sitename.org") } { set blah [HTTP::uri] switch -glob [HTTP::host] { "/" { HTTP::redirect "http://sitename.org" } default { HTTP::redirect "http://sitename.org$blah" } } } }
Bhattman - Joe_Pipitone
Nimbostratus
From what I've read, the error relates to having 2 redirects in the same statement - does this help? - hoolio
Cirrostratus
Hi Joe,
The error indicates there are two blocks of iRule code trying to send an HTTP redirect or response from an iRule. This can be in one iRule or multiple iRules on the same VIP. The iRule you've posted above cannot be the sole cause as it is can only send a single redirect per HTTP request. Do you have another iRule enabled on the VIP which is also sending a redirect?
Also, since you're not using any wildcards on the switch cases, you don't need to use the -glob flag.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects