Forum Discussion

5 Replies

  • Can you give us your complete requirement, as in when to redirect to a particular pool and to a URI. How many URL's/FQDN are involved, under what condition to which pool ?

     

  • I have pool with one node that listens port 8888,

     

    and I need to create iRule for example: simple.com to redirect my pool + "/test"

     

    result must be simple.com/test

     

    this doesn't work

     

    when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "simple.com" } { pool "/Common/my_pool" + "/test"

     

  • Are you saying that your webservers will process the request only when there's /test path in the URI, when the client misses it out in the original request. Do you want this to be transparent in the client's browser. More like a URI mapping.

     

    Or are you talking a simple redirection here.

     

  • I think transparent but can you give me both irules and than I test them and will choose one of them.

     

  • PFB,

    Redirect one

    when HTTP_REQUEST {
    if { [HTTP::host] equals "simple.com" && [HTTP::uri] starts_with "/test" } {
    pool my_pool 
    } else {
    HTTP::redirect https://[HTTP::host]/test[HTTP::uri] }
    }
    

    Transparent, updating the URI and sending it to the backend member.

    when HTTP_REQUEST { 
    if { [HTTP::host] equals "simple.com" && [HTTP::uri] equals "/" }
    HTTP::uri [string map {"/" "/test/"} [HTTP::uri]]
    }