Forum Discussion

  • Hi,

    That looks good. Assuming you're using the iRule on an HTTP (not HTTPS) virtual server, you could also redirect all other URIs to https:// preserving the URI:

    
    when HTTP_REQUEST {
       if { [HTTP::path] equals "/" } {
          HTTP::redirect "https://webmail.mycompany.com/owa"
       } else {
          HTTP::redirect "https://webmail.mycompany.com[HTTP::uri]"
       }
    }
    

    Aaron
  • Thanks, so this is only a 443 VS. Would I need to fire up an 80 VS to setup this redirect?
  • the irule should be on HTTP (not HTTPS) virtual server since user request (http://webmail.mycompany.com) is coming to port 80.
  • e.g.

    [root@ve1023:Active] config  b virtual bar list
    virtual bar {
       destination 172.28.19.79:80
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve1023:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
       if { [HTTP::path] equals "/" } {
          HTTP::redirect "https://webmail.mycompany.com/owa"
       } else {
          HTTP::redirect "https://webmail.mycompany.com[HTTP::uri]"
       }
    }
    }
    [root@ve1023:Active] config  curl -I http://webmail.mycompany.com
    HTTP/1.0 302 Found
    Location: https://webmail.mycompany.com/owa
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0
    
    [root@ve1023:Active] config  curl -I http://webmail.mycompany.com/somethingelse
    HTTP/1.0 302 Found
    Location: https://webmail.mycompany.com/somethingelse
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0