so basically i want it to look for "/" or "owa" and redirect it to only https://webmail.company.com/owa/. ignoring all other bits of uri.
is the logic (redirect / or /owa/something to /owa/) indeed correct? i think it may cause an issue in accessing application. anyway, this is an example.
configuration
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/owa/" {
Do nothing
}
"/" -
"/owa/*" {
HTTP::redirect "https://[HTTP::host]/owa/"
}
default {
Do nothing
}
}
}
}
test
[root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/
HTTP/1.0 302 Found
Location: https://172.28.24.10/owa/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/owa/something
HTTP/1.0 302 Found
Location: https://172.28.24.10/owa/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/owa/
HTTP/1.1 404 Not Found
Date: Tue, 02 Jun 2015 04:12:26 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
ETag: "41879c-59-2a9c23c0"
Accept-Ranges: bytes
Content-Length: 89
Content-Type: text/html; charset=UTF-8