Forum Discussion
IheartF5_45022
Nacreous
so if I am correctly interpreting your requirements, you want to force /dd to HTTPS, and if it is HTTPS, rewrite the URI to /xx/yyy/ddd?
when HTTP_REQUEST {
if {[HTTP::uri] eq "/dd"} {
if {[TCP::local_port] == 80} {
Force to HTTPS
HTTP::redirect "https://[HTTP:host][HTTP::uri]
return
} else {
It's already HTTPS, rewrite URI
HTTP::uri "/xx/yyy/ddd"
}
}
Christian_30338
Dec 16, 2013Historic F5 Account
I am assuming that you have a port 80 virtual server and a port 443 virtual server. If the iRule posted above is working OK on HTTPS website then just enable the HTTP to HTTPS redirect on the port 80 virtual server. Something simple like this should do the redirect.
when HTTP_REQUEST {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}