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
- The_Bhattman
Nimbostratus
Hi Jato,
Did you search the forum to see if anyone found the same issue
I hope this helps
Bhattman - Michael_Yates
Nimbostratus
A 301 HTTP Status Code is a "Moved Permanently" message, but you are only doing an HTTP to HTTPS Redirect to the same website.
Using the HTTP::host would in this redirect this way would create an endless loop. You have to give it somewhere else to go:when HTTP_REQUEST { HTTP::respond 301 Location "https://www.differentwebsite.com[HTTP::uri]" }
If you just want to do you HTTP to HTTPS Redirect, try this:when HTTP_REQUEST { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] } - jato_40959
Nimbostratus
Posted By Michael Yates on 06/02/2010 09:05 AM
A 301 HTTP Status Code is a "Moved Permanently" message, but you are only doing an HTTP to HTTPS Redirect to the same website.
Using the HTTP::host would in this redirect this way would create an endless loop. You have to give it somewhere else to go:when HTTP_REQUEST { HTTP::respond 301 Location "https://www.differentwebsite.com[HTTP::uri]" }
Thank you Michael, i think this may be ok.
If you just want to do you HTTP to HTTPS Redirect, try this:when HTTP_REQUEST { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] } - The_Bhattman
Nimbostratus
Hi Jato,
Sorry about that, for some reason it works for me.
Here is an article that be close to what you are looking for
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/afv/topic/aft/1171154/aff/5/showtab/groupforums/Default.aspx
Bhattman - hoolio
Cirrostratus
Hi Jato,
As Bhattman suggested, this is a common error and topic on DC. You can try searching the forums for "Multiple redirect/respond invocations not allowed" to find a lot of related posts.
The error is generally caused by two iRules or two commands within the same iRule trying to send the client a response for the same HTTP request. If you're trying to redirect all requests from HTTP to HTTPS, you shouldn't need to have any other iRules on the HTTP VS.
If you want more help troubleshooting the issue, can you post anonymized copies of the other iRule(s) enabled on the VS?
Aaron - jato_40959
Nimbostratus
Thanks you so much!!
But the irule isn't ok yet.
I have it:
when HTTP_REQUEST {
HTTP::respond 301 Location "https://www.domain.es[HTTP::uri]"
}
but my customer have other redirects of second level:
· www.domani1.es
· www.domain2.es
· www.domain3.es
· www.domain4.es
. www.domain5.es
with this irule i am doing a absolute redirect, then second level redirects not working.
Can anybody help me with this?
Thanx in advance - hoolio
Cirrostratus
Hi Jato,
Can you post both iRules? Can you also clarify when you want to send a redirect for www.domain.es versus www.domain1.es or www.domain2.es, etc?
Thanks,
Aaron - jato_40959
Nimbostratus
Hi Aaron,
there aren't two irules.
I want to do any redirects http to https also 301, for keep position in google for example:
http://www.mydomain.es to https://mydomain.es
http://www.mydomain1.es to https://mydomain1.es
but with 301.
Thanx in advance. - hoolio
Cirrostratus
Then you can send a 301 with the originally requested host and URI via HTTPS:when HTTP_REQUEST { HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]" }
Aaron - jato_40959
Nimbostratus
Hi Aaron,
but only for one redirect, no?
Can i do this for several redirects?
I mean.....
from http://www.mydomain.es to https://www.mydomain.es with 301
from http://www.mydomain1.es to https://www.mydomain1.es with 301
from http://www.mydomain2.es to https://www.mydomain2.es with 301
etc.......
Thank you so much for your help
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
