Scenario
You have a standard HTTP to HTTPS redirection irule which redirects all requests, but you want to make an exception for one URL and leave it on HTTP.
Solution
Apply the following irule to the HTTP VIP in question:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
when HTTP_REQUEST { # Check if domain is "subdomain.site.com" if {[string tolower [HTTP::host]] eq "subdomain.site.com"}{ # Check if URI isn't /pages/page1/ switch [HTTP::uri] { "/pages/page1/" { # Exit this event from this iRule return } } } # Redirect everything else to HTTPS HTTP::redirect " <a href="https://[http::host][http::uri]/" target="_blank" rel="noopener">https://[HTTP::host][HTTP::uri]</a> } |
Result
The subdomain.site.com/pages/page1 will not be redirected to HTTPS.
Refererence:
https://support.f5.com/kb/en-us/solutions/public/13000/100/sol13171.html