Forum Discussion
Malcolm_Salmons
Nimbostratus
20 years agoHTTP to HTTPS redirect
Hi
I've currently got a Virtual Server running https, e.g.
https://test.abc.com
This is all working correctly and load balancing happily. However I want to enable redirec...
20 years ago
Try removing the brackets around the HTTP::redirect command
when HTTP_REQUEST {
if { [HTTP::host] eq "test.abc.com"} {
HTTP::redirect "https://test.abc.com/"
}
}The square brackets evaluate the command inside the brackets and then place the result where the brackets are. You want to execute the command so you'll want to not include the brackets.
*** Update ***
I forgot to mention (as rapmaster_c did below) that you'll want to be checking based on HTTP::host and not HTTP::uri. I've updated the example above.
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects