Forum Discussion
Ken_Cottrell
Nimbostratus
May 17, 2011Multiple redirect/respond directives not allowed in logs
The rule is supposed to only fire on root "/" requests. It is supposed to not fire on user agent string matches defined in a search engine class list, but it should fire on user agent string matches defined in a mobile calls list.
If it is not a root request, it should fall through to the default pool for the VS.
As a side note, mobile.site.com is a CNAME for www.site.com
Does anyone see the problem with this rule?
when HTTP_REQUEST {
if { ([HTTP::uri] equals "/") } {
if {not([class match [string tolower [HTTP::header User-Agent]] contains user_agent_search_engine_list])} {
if {([class match [string tolower [HTTP::header User-Agent]] contains user_agent_mobile_list]) } {
HTTP::redirect http://mobile.site.com/mobile/index.jsp
}
}
}
else {
pool www.site.com_80 }
}
5 Replies
- hoolio
Cirrostratus
Hi Ken,
You only have one redirect in that iRule. Do you have another iRule on the virtual server? Or do you have an HTTP class which does a redirect? Can you post an anoymized copy of the 'b virtual VS_NAME list' output?
Thanks, Aaron - Colin_Walker_12Historic F5 AccountAlso, the specific log entry that you're seeing would be helpful. As Aaron said, that rule alone wouldn't cause a multi-redirect error.
Thanks,
Colin - Ken_Cottrell
Nimbostratus
Yes there is another iRule prior to the mobile site iRule which redirects short name to full name shown below:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
site.com {
HTTP::respond 301 Location "http://www.site.com[HTTP::uri]"
}
site2.com {
HTTP::respond 301 Location "http://www.site2.com[HTTP::uri]"
}
}
}
This is the most recent log entry for this issue:
Tue May 17 04:25:41 CDT 2011 err local/tmm tmm[4712] 01220001 TCL error: redirect-mobile-site - Operation not supported. Multiple redirect/respond invocations not allowed (line 4) invoked from within "HTTP::redirect http://mobile.site.com/mobile/index.jsp "
Thank you both for the quick response. - hoolio
Cirrostratus
A runtime error like that is expected whenever more than one redirect is attempted on a single HTTP request.
I would either combine the two iRules or set a variable in one iRule that is read by the second iRule to ensure only one iRule attempts to send a redirect. Or you could get a little fancier and use this type of logic:
http://devcentral.f5.com/wiki/default.aspx/iRules/detect_prior_http_redirect_or_respond.html
Aaron - Ken_Cottrell
Nimbostratus
Thanks for the information and options.
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