Forum Discussion

mikey_webb's avatar
Nov 25, 2014

irule help

i have the below irule which will redirect to SSL, the question is how can i change so that http://www.mysite.co.uk/ does not get redirected but remains as http - thanks

 

when HTTP_REQUEST {

 

if { !([string tolower [HTTP::host]] starts_with "www.") } {

 

HTTP::redirect [HTTP::host][HTTP::uri] } else { HTTP::redirect https://[HTTP::host][HTTP::uri] }}

 

1 Reply

  • when HTTP_REQUEST {
        switch -glob [string tolower [HTTP::host]] {
            "www.mysite.co.uk" { }
            "www*" {
                HTTP::redirect "https://[HTTP::host][HTTP::uri]"
            }
            default {
                HTTP::redirect "[HTTP::host][HTTP::uri]"            
            }
        }
    }