Forum Discussion

BinaryCanary_19's avatar
BinaryCanary_19
Historic F5 Account
Oct 16, 2013

Creating A Redirect with Local Traffic Policies v11.4

This is not a question, I'm just putting this out here to help people who have run into this problem.

Before 11.4, you could easily redirect from HTTP to HTTPS using HTTP Classes. In 11.4, HTTP Classes are no longer present, and there is not yet a solution article published showing how to accomplish the same thing using Local Traffic Policies. You should be able to get by with this for now.

  1. First, you need to Create a policy with the matching strategy of your choice, I chose “best-match”. Chose a name for the policy.
  2. This policy should require “http”, and control “forwarding”.
  3. You can then add a rule. Choose a name for the rule
  4. For the rule conditions, leave the defaults in (empty conditions list).
  5. For the actions, the target should be “http-reply”, the event should be “request” and the action “redirect”. You will have the location parameter available to you. Set the value to :
    https://[getfield [HTTP::host] ":" 1][HTTP::uri]
    . This is exactly the same as it is on the HTTP Class documentation (Ref: http://support.f5.com/kb/en-us/solutions/public/7000/100/sol7125.html?sr=32531961 )
  6. Click “Add” for the parameter, then “Add” again to add the action to the list of actions.
  7. Click Finished once done, and then you can attach this policy to the virtual server of choice, and it should redirect all requests to the HTTPS equivalent of the incoming host and URI combination.

17 Replies