Forum Discussion
Scott_85950
Nimbostratus
Sep 23, 2011iRule - HTTPS redirect to HTTP
Is it possible to redirect a URL currently rendering in HTTPS, back to HTTP?
I know that some browser types will notify users that they are about to leave
an HTTPS page, however the benefits outweig...
Michael_Yates
Nimbostratus
Sep 26, 2011Hi Scott,
I did add some protection into this iRule that will prevent an endless loop if you put this iRule on both the HTTP and HTTPS Virtual Server. It will check to see if "/pdf" exists anywhere in the URI and verify that the local port that the request came in on was 443. If both qualify it will redirect you to your HTTP Location.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/pdf" && [TCP::local_port] == 443 } {
HTTP::redirect "http://[getfield [HTTP::host] ":" 1]/pdf/[URI::basename [HTTP::uri]]"
}
}
Hope this helps.
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