Forum Discussion
Leonardo_Souza
Sep 25, 2018Cirrocumulus
The system iRule "_sys_https_redirect" should do that for you.
It uses "HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]".
From the documentation:
https://devcentral.f5.com/wiki/irules.getfield.ashx
To extract only the hostname from the host header (strips any trailing ":" port specification)
when HTTP_REQUEST {
set hostname [getfield [HTTP::host] ":" 1]
}