Forum Discussion

  • Hi Chenco,

    You can try this below redirection irule.

    when HTTP_REQUEST {
    if {[string tolower [HTTP::host]] eq "example.com"}
    HTTP::respond 301 Location "https://www.[HTTP::host][HTTP::uri]"   
    }
    
    
    Let me know if any issue.
    Thanks & Regards,
    Habib Khan
    
  • Hi,

    You can default system irule for http to https redirection. Irule name is _sys_https_redirect. when HTTP_REQUEST { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] }

    or you can use custom irule as mentioned below.
    
    when HTTP_REQUEST {
    

    if {[HTTP::host] equals "test.com"} {HTTP::respond 301 "Location" "https://test.com[HTTP::uri]"} }