Forum Discussion

7 Replies

  • this may be obvious but, have you looked in the debug screen (F12) if it is receiving HTTP code 302 for redirection? there were open connections in this browsers when you applied the iRule?
  • Hi, the irule has been applied on the VS. I ran F12 on FF, but there is NO 302 http redirect there. I have deleted all my cache and reopened my session, but still the same.

     

  • Can you add a log statement in the rule so we capture whether it's getting hit? Some browsers like to automatically throw the www in but I'd be surprised if that happened unless you didn't have a root record in DNS.

     

  • Try:

    when HTTP_REQUEST { 
        log local0. "requested host: [HTTP::host]"
        if { [string tolower [HTTP::host]] equals "www.example.ca" } { 
            log local0. "Sending HTTP 302 redirection"
            HTTP::respond 302 Location "https://example.ca"
        } else {
            log local0. "Do nothing for current request"
        }
    }
    

    and tail the LTM log on ssh Linux:

    tail -f /var/log/ltm
    
    
    
    Apr 14 14:06:08 bigipbeta info tmm1[15283]: Rule /Common/rule_to_redirect : requested host: www.example.ca
    Apr 14 14:06:08 bigipbeta info tmm1[15283]: Rule /Common/rule_to_redirect : sending HTTP 302 redirection
    
  • Thanks, i am getting random results in IE now. I want to get re-directed even before any SSL negotiation happens in order to avoid the invalid CN name ssl error. But now it does not seem to be doing that. I always get an privacy error/ssl-error and then once i accept it, i get re-directed.

     

    This worked in IE before, the redirection was happening first before any ssl-nogotiation.

     

  • I do not know when it's possible because the connection will know the URL only after established. I know we can use TLS/SNI to connection choose the appropriate certificate on ssl handshake, but it can be incompatible in legacy systems. So I do not know how to tell you a better solution right now.