I Can Rule!

This irule should allow you to redirect from http to https, as well as append a www. to the hostname if this is not already there….

If you know what an irule is, and you found this page, chances are good that this is what you’re looking for. Have fun, and pay it forward.

Remember, this is the personal blog of some dude on the internet. Use your common sense.

when HTTP_REQUEST {
set hname [substr [HTTP::host] 0 4]
#log local0. $hname
if { [string tolower $hname] equals “www.”} {
HTTP::respond 301 Location “https://[getfield [HTTP::host] “:” 1][HTTP::uri]”
} else {
HTTP::respond 301 Location “https://www.[getfield [HTTP::host] “:” 1][HTTP::uri]”
}
}

Leave a Reply