Forum Discussion

12 Replies

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    few options depending on if there are any more specifics to your use case. here are two:

    when HTTP_REQUEST {
     HTTP::uri "/test/mypage"
    }
    

    or

    when HTTP_REQUEST {
     if { [HTTP::path] equals "/" } {
     HTTP::uri "/test/mypage"
     }
    }
    

    Check out the iRules wiki for help with any other requirements. Loads of examples to help.

    N

  • None of these is working for me. It does NOT get redirected to the proper URI.

     

  • Give this a try:

    when HTTP_REQUEST {
        if { [HTTP::uri] equals "/" } {
            HTTP::redirect "https://[HTTP::host]/test/mypage"
        }
    }
    

    Also, it looks like you're trying to do this on HTTPS, is your virtual server SSL? If so you will require a client SSL profile and an HTTP profile to do this. If you want HTTPS terminated at the server, you will also need to use a server SSL profile.

  • Give this a try:

    when HTTP_REQUEST {
        if { [HTTP::uri] equals "/" } {
            HTTP::redirect "https://[HTTP::host]/test/mypage"
        }
    }
    

    Also, it looks like you're trying to do this on HTTPS, is your virtual server SSL? If so you will require a client SSL profile and an HTTP profile to do this. If you want HTTPS terminated at the server, you will also need to use a server SSL profile.