Forum Discussion
jaikumar_f5
Aug 23, 2018MVP
Think your requirement is quite below,
- http traffic with /content - Allow to unsecure_80
- http traffic without /content - Not Allow to unsecure_80 redirect to secure
- https traffic with /content - Allow to secure
- https traffic without /content - Not Allow to secure redirect to unsecure_80
Apply the below rule_http to 80VS
ltm rule rule_http {
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
“/content” { pool unsecure_80 }
"default" { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
}
}
Apply the below rule_https to 443VS
ltm rule rule_https {
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
“/content” { HTTP::redirect "http://[HTTP::host][HTTP::uri]" }
"default" { pool secure }
}
}
}
I'm sure there are lot of ways this can be achieved with single VIP Irule logic too. But this is clean and simple according to me.