Forum Discussion
Arie
Altostratus
Jun 30, 2008Multiple redirect/respond invocations not allowed
I keep running into this error:
"Multiple redirect/respond invocations not allowed"
We've got a fair number of web sites that all seem to have their own redirect requirements (often redirecting to other sites), so we've got stacked redirects. Combining the redirects in one large redirect iRule is not an option since different VSs have different combinations of redirects.
Here's the framework for most redirects:
when HTTP_REQUEST {
set wwwRedirect true
if { $wwwRedirect } {
if { not ([matchclass [string tolower [HTTP::host]] equals $::ExcludeFromWWWRedirect]) and not ([string tolower [HTTP::host]] starts_with "www") } {
HTTP::respond 301 Location "http://www.[HTTP::host][HTTP::uri]"
return 0
}
}
}
I assumed that the "return" command would instruct the LTM to abort further processing of iRules at this time and return control to the caller.
- hoolio
Cirrostratus
Return will stop the processing of that event in that iRule. It won't affect other events or other iRules enabled on the same VIP. - Robert_Sutcliff
Nimbostratus
Hi, - Arie
Altostratus
Good to know that "return" applies to the current iRule only.
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