Forum Discussion
Operation not supported. Multiple redirect/respond invocations not allowed
I am receiving the following error in the ltm log (private data has been modified).
TCL error: redirect_irule - Operation not supported. Multiple redirect/respond invocations not allowed (line 9) invoked from within "HTTP::respond 307 "Location" "https://www.fruit.com[HTTP::uri]"
I have seen previous posts on the error, but cannot find a way to perform all of the redirects without multiple response/redirect lines in the irule. The iRule is listed below.
when HTTP_REQUEST { set host [HTTP::host] set uri [HTTP::uri]
switch -glob [string tolower [HTTP::host]] { "lemons.com" { HTTP::respond 301 "Location" "https://www.fruit.com/links/test?[HTTP::query]" } } if { $host contains "apples.com" and $uri contains "tree" } { HTTP::respond 307 "Location" "http://web.fruit.com/tree.aspx" } else { HTTP::respond 307 "Location" "https://www.fruit.com[HTTP::uri]" } }
The goal is to have the redirects in place. Currently, the LTM is intermittently sending resets (RSTs) back to the client for www.lemons.com and lemons.com. Sometimes the browser issues a redirect and other times it doesn't due to the reset.
www.lemons.com -> redirect to https://www.fruit.com/links/test?[HTTP::query] lemons.com -> redirect to https://www.fruit.com/links/test?[HTTP::query] www.apples.com -> redirect to https://www.fruit.com apples.com/tree -> redirect to https://www.fruit.com/[HTTP::uri]
Thanks.
2 Replies
- RobertColbert
Nimbostratus
The easiest way to handle this is to do a TCP::Close followed by return
As long as that is the only iRule doing redirects, you should stop seeing the warnings in the log.
- Mohamed_Lrhazi
Altocumulus
Is this logic the same as what you need? would it work better?
when HTTP_REQUEST { set host [string tolower [HTTP::host]] set uri [HTTP::uri] if {$host equals "lemons.com" } { HTTP::respond 301 "Location" "https://www.fruit.com/links/test?[HTTP::query]" } elseif { $host contains "apples.com" and $uri contains "tree" } { HTTP::respond 307 "Location" "http://web.fruit.com/tree.aspx" } else { HTTP::respond 307 "Location" "https://www.fruit.com[HTTP::uri]" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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