Forum Discussion
Prakash_Bhavsar
Nimbostratus
Jun 22, 2006Multiple redirect not allowed
I have BigIP with Version 9.2.2. I have following iRule configured for my web site. I can not get redirect for uri starting with "/returns.jsp". I am getting error saying "Multiple redirect are not supported" can you please check my rule and help me with error.
Thanks
--------------------------
iRule
when HTTP_REQUEST {
if {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] contains "/fif="}
{use pool pei_staging_8087_pool}
elseif {[HTTP::uri] contains "user" or [HTTP::uri] contains "checkout" }
{HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
if {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] starts_with "/dialogcentral"}
{use pool pei_staging_1080_pool}
elseif {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] starts_with "/returns.jsp"} {HTTP::redirect "http://staging.originalpenguin.com/opg/service/customer_care_returns_exchanges.jsphandling"}
if {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] starts_with "/opg"}
{use pool pei_staging_1080_pool}
else {
HTTP::redirect "http://staging.originalpenguin.com/opg/"
}
}
------------------------------
Error Log on BigIP
Jun 22 16:54:06 tmm tmm[987]: 01220001:3: TCL error: Rule staging_http_2 REQUEST> - Operation not supported. Multiple redirect/respond invocations not allowed (line 12) invoked from within "HTTP::redirect "http://staging.originalpenguin.com/opg/" "
- Deb_Allen_18Historic F5 AccountF5 has made some adjustments to default TCL behaviour to allow "else" to occur @ the beginning of a line, but I'd suggest re-arranging the structure of the rule so the "else" statements are on the same line as the "}", to conform w/standard TCL syntax:
Looking closely at the conditions you've created, there are 3 separate "if" statements, and there are indeed 2 redirects if a condition matches in one of the first 2 and you fall out to the "else" in the third.when HTTP_REQUEST { if {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] contains "/fif="}{ use pool pei_staging_8087_pool } elseif {[HTTP::uri] contains "user" or [HTTP::uri] contains "checkout" }{ HTTP::redirect "https://[HTTP::host][HTTP::uri]" } if {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] starts_with "/dialogcentral"}{ use pool pei_staging_1080_pool } elseif {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] starts_with "/returns.jsp"}{ HTTP::redirect "http://staging.originalpenguin.com/opg/service/customer_care_returns_exchanges.jsphandling" } if {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] starts_with "/opg"}{ use pool pei_staging_1080_pool } else { HTTP::redirect "http://staging.originalpenguin.com/opg/" } }
HTHwhen HTTP_REQUEST { if {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] contains "/fif="}{ use pool pei_staging_8087_pool } elseif {[HTTP::uri] contains "user" or [HTTP::uri] contains "checkout" }{ HTTP::redirect "https://[HTTP::host][HTTP::uri]" return } elseif {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] starts_with "/dialogcentral"}{ use pool pei_staging_1080_pool } elseif {[HTTP::host] contains "staging.originalpenguin.com" and [HTTP::uri] starts_with "/returns.jsp"}{ ...
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