Forum Discussion
Joe_Pipitone
Nimbostratus
Apr 13, 2010Big-ip syslog errors continue
After combining multiple redirect iRules into one master iRule, I'm still getting the following error in the big-ip logs.
I was under the impression that having separate iRules with redirect statements would cause this, however I am now thinking it is because I'm using a switch statement with multiple cases.
Can anyone help? Below is the error, followed by my gigantic iRule.
TCL error: my-rewrite-rule HTTP_REQUEST - Operation not supported. Multiple redirect/respond invocations not allowed
line 192 invoked from within HTTP::redirect http://domain.com[HTTP::uri] default
arm line 1 invoked from within switch -glob [HTTP::host] { / { HTTP::redirect
http://domain.com } default { HTTP::redirect http://domain.com[HTTP::uri] } ...
ssl and marketing rewrites
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
"/login/default-login.aspx" {
HTTP::redirect "https://domain.com[HTTP::uri]"
}
"/forms/buy.aspx" {
HTTP::redirect "https://domain.com[HTTP::uri]"
}
"/forms/changeform.aspx" {
HTTP::redirect "https://domain.com[HTTP::uri]"
}
"/forms/registrationform.aspx" {
HTTP::redirect "https://domain.com[HTTP::uri]"
}
"/forms/changepassword.aspx" {
HTTP::redirect "https://domain.com[HTTP::uri]"
}
"/forms/renewform.aspx" {
HTTP::redirect "https://domain.com[HTTP::uri]"
}
"/redirects/marketing/somepage.aspx?campaignid=2493" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2494" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2495" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2496" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2497" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2498" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2499" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2500" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2501" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2502" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2503" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaignid=2504" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/redirects/marketing/somepage.aspx?campaigngroupid=17" {
HTTP::redirect "http://subdomain.domain.com/events/some-path-here/home.aspx"
}
"/membership/benefits*" {
HTTP::redirect "http://domain.com/pages/members/some-page.aspx"
}
"/poster*" {
HTTP::redirect "http://domain.com/pages/posters/some-page.aspx"
}
"/publications/poster.aspx" {
HTTP::redirect "http://domain.com/pages/posters/some-page.aspx"
}
"/orlando2009bi*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2463"
}
"/orlando2009bi/register*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2464"
}
"/orlando2009bi/hotel*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2465"
}
"/orlando2009bi/coursepreviews*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2466"
}
"/2009orlandobi*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2467"
}
"/2009orlandobi/register*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2468"
}
"/2009orlandobi/hotel*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2469"
}
"/2009orlandobi/coursepreviews*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2470"
}
"/or2009*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2471"
}
"/ontheroad/dc09*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2472"
}
"/ontheroad/09dc*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2473"
}
"/ontheroad/09vancouver*" {
HTTP::redirect "http://domain.com/Redirects/Marketing/somepage.ASPX?CampaignId=2474"
}
"/whatworks27wp*" {
HTTP::redirect "http://domain.com/Publications/ww27whitepapers.aspx"
}
"/whatworks28wp*" {
HTTP::redirect "http://domain.com/Publications/ww28whitepapers.aspx"
}
"/lv2010/instructors*" {
HTTP::redirect "http://events.domain.com/events/speakers/speaker-list.aspx"
}
"/lv2010/hotel*" {
HTTP::redirect "http://events.domain.com/events/information/hotel-and-travel.aspx"
}
"/lv2010/register*" {
HTTP::redirect "http://events.domain.com/events/information/registration.aspx"
}
"/lv2010/fax*" {
HTTP::redirect "http://events.domain.com/events/information/registration.aspx"
}
"/lasvegas10*" {
HTTP::redirect "http://events.domain.com/events/home.aspx"
}
"/lv2010" {
HTTP::redirect "http://events.domain.com/events/home.aspx"
}
"/lv2010/" {
HTTP::redirect "http://events.domain.com/events/home.aspx"
}
"/lasvegas2010*" {
HTTP::redirect "http://events.domain.com/events/home.aspx"
}
"/lv2010/es/register*" {
HTTP::redirect "http://events.domain.com/events/information/registration.aspx"
}
"/lv2010/es/hotel*" {
HTTP::redirect "http://events.domain.com/events/information/hotel-and-travel.aspx"
}
"/lv2010/es/qualify*" {
HTTP::redirect "http://events.domain.com/events/information/qualification.aspx"
}
"/lv2010/es*" {
HTTP::redirect "http://events.domain.com/events/home.aspx"
}
"/education/seminars/index.aspx" {
HTTP::redirect "http://events.domain.com/events/some-path/home.aspx"
}
"/seminars/boston*" {
HTTP::redirect "http://events.domain.com/events/some-path/information/boston-seminar.aspx"
}
"/seminars/seattle*" {
HTTP::redirect "http://events.domain.com/events/some-path/information/seattle-seminar.aspx"
}
"/seminars/minneapolis*" {
HTTP::redirect "http://events.domain.com/events/some-path/information/minneapolis-seminar.aspx"
}
"/seminars/denver*" {
HTTP::redirect "http://events.domain.com/events/some-path/information/denver-seminar.aspx"
}
"/seminars/toronto*" {
HTTP::redirect "http://events.domain.com/events/some-path/information/toronto-seminar.aspx"
}
"/seminars/dc*" {
HTTP::redirect "http://events.domain.com/events/some-path/information/washington-dc-seminar.aspx"
}
}
another subdomain rewrite
switch [string tolower [HTTP::path]] {
"/info.aspx" {
HTTP::redirect "http://subdomain.ourdomain.com/default.aspx?[HTTP::query]"
}
}
legacy rewrite
if {[HTTP::uri] starts_with "/admin" } {
HTTP::redirect "http://legacy.domain.com[HTTP::uri]"
}
strip www
if { ([HTTP::host] eq "www.domain.com") } {
switch -glob [HTTP::host] {
"/" { HTTP::redirect "http://domain.com" }
default { HTTP::redirect "http://domain.com[HTTP::uri]" }
}
}
}
- hoolio
Cirrostratus
Hi Joe, - Joe_Pipitone
Nimbostratus
The problem with combining all of the redirect statements into the switch is - see my comment towards the bottom of the script - another subdomain rewrite. If I combine this one with the others above, the redirect only half works. It rewrites the url but does not pass along the uri query string as part of the full url. Unless I use the http::path, it won't work. - Joe_Pipitone
Nimbostratus
Can anyone help with syntax of exiting the HTTP_REQUEST? Or point me in the right direction as far as where to find big-ip docs for this syntax? - hoolio
Cirrostratus
Hi Joe,switch -glob [string tolower [HTTP::uri]] { ...other checks... "/info.aspx" - "/info.aspx\?*" { HTTP::redirect "http://subdomain.ourdomain.com/default.aspx?[HTTP::query]" } }
if {[HTTP::uri] starts_with "/admin" } { HTTP::redirect "http://legacy.domain.com[HTTP::uri]" } elseif {[string tolower [HTTP::host]] eq "www.domain.com"}{ HTTP::redirect "http://domain.com[HTTP::uri]" }
- Joe_Pipitone
Nimbostratus
For example, this code below will not carry over the query if i change HTTP::path to HTTP::uri. It simply rewrites to default.aspx with no query appended.switch [string tolower [HTTP::path]] { "/info.aspx" { HTTP::redirect "http://subdomain.ourdomain.com/default.aspx?[HTTP::query]" } }
- Joe_Pipitone
Nimbostratus
Wow - your trickery works like a charm - thank you very very very much for the help, I can finally put this to bed!
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