Mar 27, 2026 - For details about updated CVE-2025-53521 (BIG-IP APM vulnerability), refer to K000156741.

Forum Discussion

3 Replies

  • There's a few ways to skin this depending on what you mean by "redirect". Generally when you say "redirect" with respect to HTTP traffic, you mean issuing a 30x redirect response to the user. Otherwise, you might simply mean silently changing the URI path as it flows through the proxy. The former is seen and handled by the client, whereas the latter the client doesn't see.

    But I'll assume for this instance, and because it's usually better form, that you mean an actual 30x redirect.

    when HTTP_REQUEST {
        switch -glob [string tolower [HTTP::uri]] {
            "/xxxx" {
                HTTP::redirect "https://[HTTP::host]/xxxx/web/home/index.html"
            }
            "/yyyy" {
                HTTP::redirect "https://[HTTP::host]/yyyy/forms/index.html"
            }
            "/xxxx*" {
                pool pool_A
            }
            "/yyyy*" {
                pool pool_B
            }
        }
    }

    The above basically says, if the URI is /xxxx or /yyyy, perform a 30x redirect to the correct URI path. If the URI starts with /xxxx or /yyyy (contains more than just that string), then send to a pool.

     

  • Thanks Kevin, It worked, now I have another requiremen, the rediretion based on http method.  

    How to configure an HTTP virtual server to redirect based on http method??

    • Kevin_Stewart's avatar
      Kevin_Stewart
      Icon for Employee rankEmployee

      Use the HTTP::method condition:

      when HTTP_REQUEST {
         if { [HTTP::method] eq "POST" } {
            HTTP::redirect...
         }
      }

      or

      when HTTP_REQUEST {
         switch [HTTP::method] {
            "POST" {
               HTTP::redirect...
            }
            "GET" {
               HTTP::redirect...
            }
            "UPDATE" {
               HTTP::redirect...
            }
            default {
               HTTP::redirect...
            }
         }
      }