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 (...
Robert_Sutcliff
Nimbostratus
Jul 01, 2008Hi,
You may notice that HTTP::respond (and HTTP::redirect) do various wierd things...
They sets the relevant headers and content for the response, and sends the response (once the HTTP_REQUEST event has completed)
Because it is sending the response itself, the HTTP_RESPONSE event will never be triggered (although other later events still are, eg CLIENT_CLOSED)
Unless you are doing further processing on the HTTP_REQUEST event (eg logging, setting other headers) I would suggest you also use the "event HTTP_REQUEST disable" statement (before "return"ing from this iRule). This causes TMM to not process any further iRules for this event (or rather, specifically the HTTP_REQUEST event)
So your statement block might become something like (set the response, don't process any other rules, exit this rule)
HTTP::respond 301 Location "http://www.[HTTP::host][HTTP::uri]"
event HTTP_REQUEST disable
return
The other alternative would be to set a variable (binary switch) if a redirect has been issued, and check that this isn't set before doing any other redirects
Regards,
Rob.
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