scampbell_82082
Mar 10, 2008Nimbostratus
Rewriting 3xx responses from http to https only for on-site URLs
I started out by using the "Redirect Rewrite All" option in my HTTP profile. However, the Location header in the 3xx HTTP responses was being rewritten from HTTP to HTTPS whether the hostname was on-site or off-site.
I need a "Redirect Rewrite", but only when a particular hostname is present. I talked to F5 support and they said that I needed to build an iRule.
Here is my setup:
client -HTTPS-> myapp.example.com -> BigIP -HTTP-> web server pool
When the HTTP response code is 3xx and the Location header has the hostname myapp.example.com, I want the Location header to be rewritten from HTTP to HTTPS.
If the Location header for the 3xx response is some other hostname, such as www.cnn.com, then I want the iRule to leave it alone.