iRule Recipe 1: Single URL Explicit Redirect
 Series Introduction 
 Let's face it: there aren't many people out there who have extensive experience with Tcl. Since iRules is a Tcl dialect, that means that finding a solid iRules solution can be ...
Updated Jun 06, 2023
Version 2.0VernonWells Employee
Employee
I am an F5 Solutions Architect for Service Providers in the Americas, focusing on Virtualization, SP protocols (Diameter, GTP, DNS) and programmability.
Prior to joining F5, I worked as a Wi-Fi Network Engineer for a large U.S. public University, as an Operations Engineer, a network management Software Engineer, and as a Technical Trainer.VernonWells Employee
Employee
Mar 05, 2018Absolutely. In that case, you could use a
switchclassAnyhow, a
switchwhen HTTP_REQUEST {
    switch [string tolower [HTTP::host]] {
        "abc.com" -
        "def.com" {
            switch -glob [HTTP::path] {
                "/first/second" -
                "/first/second/*" {
                    HTTP::respond 301 Location "https://aaa.bbb.com/"
                }
            }
        }
    }
}
This would redirect any request for abc.com or def.com that has a URI Target path starting with /first/second to ";.