Help with redirect https

I wrote this iRule below and it works great for the most part but, when someone types https://iam.company.com it won’t redirect. It only redirects http://iam.company.com to https://iam.company.com:8443/aveksa/main. Is there a way to get it to redirect https as well? Thanks for your help!

when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq “iam.company.com” } then { if { [HTTP::uri] eq “/” } then { HTTP::redirect “https://iam.company.com:8443/aveksa/main” } } }

I’m guessing you have two vips, one on 80 and one on 443 and this irule is on the 80 vip. If you put it on BOTH the 80 vip and the 443 vip, you will get the behavior you desire.

Have you attached that irule to the VS listening on port 8443?