Forum Discussion
SP_266134
Nimbostratus
Jan 23, 2019redirect http requests to https
Hi Guys,
I have a two vips one is at 443 and another one dummy vip with same address at port 80 for http traffic.
when users go to all works fine. with other vip if user goes http://domain.com, it ...
Kai_Wilke
MVP
Jan 23, 2019Hi SP,
if is the only web application on the IP, then simply redirect to a fixed HOST-value. It will work in any case...
when HTTP_REQUEST {
HTTP::respond 301 "Location" "https://www.domain.com[HTTP::uri]"
HTTP::respond 302 "Location" "https://www.domain.com[HTTP::uri]"
}
Note: If you don't use HTTP to access your web site and also not plan to use it in the future, then it would be far more elegant to send a 301 (Permanent Redirect) instead of 302 (Temporary Redirect) response. The
command can only send 301 (Temporary Redirect) responses, but the HTTP::redirect
command can either send a HTTP::respond
or 301
redirect response (see example above). 302
Cheers, Kai
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