Forum Discussion
Andres_Calderon
Nov 15, 2006Nimbostratus
need help with redirect https to http
Hello.
How can I redirect https to http using an iRule
Deb_Allen_18
Nov 16, 2006Historic F5 Account
I recently updated the description of this iRule in the codeshare to address this point of confusion -- if the virtual to which it is applied is processing HTTPS traffic on port 443, it will result in an infinite redirect loop:
Link above now gives the following guidance:Do not apply this iRule to shared/wildcard virtual server responding to HTTPS traffic, or infinite redirect will occur. Create separate virtual servers on port 80 and port 443, and apply this iRule ONLY to the port 80 HTTP-only virtual server. No iRule is needed on the port 443 HTTPS virtual server.
The above rule may be modified to function on a shared virtual server by testing [TCP::local_port] and redirecting only if the request came in over port 80:
when HTTP_REQUEST {
if { [TCP::local_port] == 80 }{
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}
(Adding this enhancement to the same codeshare page linked above.)/deb
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