how to do simple redirection using iRule

Hello,

I have a site www.myserver.com which is not registered with SSL. But I have a certificate for https://myserver.com. Can anyone help putting an iRule where when user access www.myserver.com it redirect to https://myserver.com ?

Much appreciate

when HTTP_REQUEST {
  if {[HTTP::host] eq "www.myserver.com"} {
    HTTP::redirect "https://myserver.com[HTTP::uri]"
  }
}

Thanks Kevin :slight_smile:

Don’t forget to tick the left of the post that provided the answer for you. This provides recognition to the volunteers help others on this site.