Forum Discussion
jato_40959
Nimbostratus
Jun 02, 2010Redirect 301
I have implemented this irule in my system:
when HTTP_REQUEST {
HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
The irule isn't working, i found this message in logs:
Jun 1 09:49:11 local/tmm1 err tmm1[26096]: 01220001:3: TCL error: HTTP_To_HTTPS_Redirect_301 - Operation not supported. Multiple redirect/respond invocations not allowed (line 1) invoked from within "HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
Jun 1 10:24:44 local/tmm2 err tmm2[26097]: 01220001:3: TCL error: HTTP_To_HTTPS_Redirect_301 - Operation not supported. Multiple redirect/respond invocations not allowed (line 1) invoked from within "HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
Can anyone help me?
Thanx in advance and regards
18 Replies
Sort By
- hoolio
Cirrostratus
[HTTP::host] will return whatever the client requested. So if the request was made to www.mydomain1.es/index.html, the redirect will be sent to https://www.mydomain1.es/index.html. If the request was made to www.mydomain2.es/index.html, the redirect will be sent to https://www.mydomain2.es/index.html. - jato_40959
Nimbostratus
Posted By hoolio on 06/14/2010 05:58 AM - hoolio
Cirrostratus
Are you sure there isn't another iRule enabled on the VS? Or have you added something else to that iRule? The error you've posted should only occur when one or more iRules attempts to send a HTTP response or redirect multiple times for the same HTTP request. - jato_40959
Nimbostratus
I have two irules: - The_Bhattman
Nimbostratus
Hi Jato,when HTTP_REQUEST { if {[HTTP::host] equals "www.my domain.es" } { switch -glob [string to lower [HTTP::header User-Agent]] { "mid*" - "cidc*" { HTTP::redirect "https://wap.my domain.es" } default " { HTTP::respond 301 Location https://[get field [HTTP::host] ":" 1][HTTP::uri] } } } }
- jato_40959
Nimbostratus
Hi Bhattman! - hoolio
Cirrostratus
The error occurs if you try to send more than one response using HTTP::redirect or HTTP::respond for the same request. So this would cause the error:when HTTP_REQUEST { HTTP::respond 200 content "first response" HTTP::redirect "http://second.example.com/" }
- jato_40959
Nimbostratus
Ok,
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