maher_69299
Mar 01, 2010Nimbostratus
HTTPS Redirect
Can you please tell me what is wrong with this IRULE. It works fine for HTTP but I couldn't make it to work for HTTPS.
when HTTPS_REQUEST {
Check if host header value is not www.xxx.com
if {not ([string tolower [HTTPS::host]] eq "www.xxx.com")}{
Send a 301 redirect
HTTPS::respond 301 Location "https://www.xxx.com/"
}
}
Here is the error message I get
01070151:3: Rule [HTTPS-Redirect-Irule] error:
line 1: [unknown event (HTTPS_REQUEST)] [when HTTPS_REQUEST {
Check if host header value is not www.xxx.com
if {not ([string tolower [HTTPS::host]] eq "www.xxx.com")}{
Send a 301 redirect
HTTPS::respond 301 Location "http://www.xxx.com/"
}
}]
Thanks