Forum Discussion

KJ_50941's avatar
KJ_50941
Icon for Nimbostratus rankNimbostratus
Jan 07, 2019

Help with redirect Irule and pool selection

currently on F5 VIP I have created pool section iRule as below which works great, however new requirement is to redirect from "https://www.example.com/test/login to https://www.example.com/test2 so users don't have to type new url ( https://www.example.com/test2) .

when HTTP_REQUEST {

log local0. "Requesting URI is [string tolower [HTTP::uri]] and Path is [string tolower [HTTP::path]]"

switch -glob [string tolower [HTTP::uri]] {

                            "/test/*"       { pool test_Pool }

                            "/test2/*"       { pool test2_Pool }
                            }
                            }

1 Reply

  • switch -glob [string tolower [HTTP::uri]] {
        "/test/login" { HTTP::redirect "https://www.example.com/test2" }
        "/test/*" { pool test_Pool }
        "/test2/*" { pool test2_Pool }
    }