e.g.
config
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
if { [HTTP::host] eq "testssl.mydomainmail.co.uk" } {
switch [string tolower [HTTP::path]] {
"/" {
HTTP::redirect "https://testssl.mydomain.co.uk/login"
}
default {
HTTP::redirect "https://testssl.mydomain.co.uk[HTTP::uri]"
}
}
} elseif { [HTTP::host] eq "testssl.mydomain.co.uk" } {
switch -glob [string tolower [HTTP::path]] {
"/login" -
"/???lz/*" {
HTTP::redirect "https://testssl.mydomain.co.uk[HTTP::uri]"
}
}
}
}
}
test
[root@ve11a:Active:In Sync] config curl -I http://testssl.mydomainmail.co.uk
HTTP/1.0 302 Found
Location: https://testssl.mydomain.co.uk/login
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I http://testssl.mydomainmail.co.uk/anythingbhabhabha
HTTP/1.0 302 Found
Location: https://testssl.mydomain.co.uk/anythingbhabhabha
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I http://testssl.mydomain.co.uk/login
HTTP/1.0 302 Found
Location: https://testssl.mydomain.co.uk/login
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I http://testssl.mydomain.co.uk/123lz/anythingbhabhabha
HTTP/1.0 302 Found
Location: https://testssl.mydomain.co.uk/123lz/anythingbhabhabha
Server: BigIP
Connection: Keep-Alive
Content-Length: 0