http to https irule for https VIP
I need a simple http to https irule to apply to an HTTPS VIP. This is a Windows RDS gateway on the F5. We want ANY intial connection for http be directed to https. There is no http VIP since it's a HTTPS Site only. Example User types: http://www.example.com/rdweb/pages/en-US/login.aspx
They should be immediately redirected to:
https://www.example.com/rdweb/pages/en-US/login.aspx
I tried the following but cannot get to load via bigpipe OR TMSH
tmsh create ltm rule/common/rds_redirect when HTTP_REQUEST { if {[HTTP::host] equals "rdsgateway.example.com" and [HTTP::uri] starts_with "/rdweb/" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }
Fails with multiple errors.
Using the bigpipe command does nothing but show me a list of .sh entries (I don't know where that came from) b rule RDS_redirect '{ when HTTP_REQUEST { if { [HTTP::host] equals "www.example.com" and [HTTP::uri] starts_with "/rdweb/" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }}'
BIG-IP Version 10.2.4 860.0
I have little experience in writing irules but have been successful on a few basics. I am open to ANY suggestions. The simpler the better. Thanks!