For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Justin_Yaple_99's avatar
Justin_Yaple_99
Icon for Nimbostratus rankNimbostratus
Aug 19, 2005

uri redirect to http/uri

Im new to using the F5 BigIP load balancers, and am having trouble getting an http/uri to redirect to https/uri. Iv looked at as many examples I could find, but wasn’t able to make them work.

 

 

Basically Im trying to redirect http://host.com/login/login.asp to https://host.com/login/login.asp what would be the easiest means to do this?

 

3 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Yaplej,

    This is a pretty simple rule that would look like:

    
    when HTTP_REQUEST {
      if {[HTTP::host] eq "host.com" && [HTTP::uri] contains "login.asp"} {
        HTTP::redirect "https://[HTTP::host]/[HTTP::uri]"
      }
    }

    -Colin
  • Great I created my iRule https-login-redirect as follows:

     

    when HTTP_REQUEST {

     

    if {[HTTP::host] eq "www.firemountaingems.com" && [HTTP::uri] contains "login.asp"} {

     

    HTTP::redirect "https://[HTTP::host]/[HTTP::uri]"

     

    }

     

    }

     

     

    That look correct?

     

     

    Then I assign it to the VS as a resource using manage iRules so after I do that it still doesnt redirect any http:\\www.firemountaingems.com requests that contain login.asp in the [HTTP::uri]

     

     

    Am I missing something?
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    No, that looks correct to me. Perhaps the if statement isn't matching? Have you tried just putting in the redirect statement, without the if comparison? Perhaps add some logging to see what's going on?

     

     

    -Colin