Forum Discussion
hooleylist
Jul 27, 2010Cirrostratus
As Hamish said, the HTTP iRule should work okay on an HTTPS VS that has a client SSL profile enabled to decrypt the SSL. You can check whether to send an HTTP or HTTPS redirect based on whether the client used an SSL cipher. As Hamish suggested, this should avoid a browser warning about switching from HTTPS to HTTP.
when HTTP_REQUEST {
Hide the SSL:: command from the iRule parser
so the iRule can be used on a non-client SSL VS
set cipher_cmd "SSL::cipher version"
Check if the client used an SSL cipher and it's not "none"
if {not ([catch {eval $cipher_cmd} result]) && $result ne "none"}{
Client did use a cipher
set proto "https"
} else {
Client did not use a cipher
set proto "http"
}
}
when HTTP_RESPONSE {
Check the server response code
switch [HTTP::status] {
404 -
500 {
HTTP::redirect "$proto://polite_message.com/index.htm"
}
}
}
Aaron