Forum Discussion

AEisiminger_192's avatar
Historic F5 Account
Dec 02, 2010

IRule to Replace http:// with https://

I'm posting this for future users looking for a solution on how to redirect request to https that come in on http.



This IRule will match the HOST and URI and send the connection back over to the HTTPS VIP.



when RULE_INIT {


Enables or Disables debuging, set to 1 to enable 0 to disable


set static::debug 0






Log incoming request information.


if { $static::debug } { log local0.alert "[HTTP::host] [HTTP::uri]" }


set new_url "https://"


append new_url [HTTP::host]


append new_url [HTTP::uri]



HTTP::redirect $new_url



Log Redirect sting


if { $static::debug } { log local0.alert " $new_url" }




1 Reply

  • Hi,



    Thanks for sharing. Here is another option that should be slightly more efficient as it uses fewer variables and commands.