Forum Discussion
demmo_251289
Nimbostratus
Oct 12, 2016Redirect to different domain also force http to https
Hi guys,
I have three domains (a, b and c) and i want to redirect first two of them (a,b) to the last (c), also force http to https for all of them.
I put together below rule which works but I w...
Vijay_E
Cirrus
Oct 12, 2016Are you using separate VS for port 80 and another VS for 443 ? If so, you can use something like this:
when HTTP_REQUEST {
HTTP::redirect "https://c[HTTP::uri]"
}
I am assuming that VS1:80 is for handling the 3 domains ONLY i.e., no other domain relies on that VS1:80. If you have multiple domains relying on VS1:80, you can use something like this:
when HTTP_REQUEST {
switch -glob [HTTP::host] {
"a" -
"b" -
"c" { HTTP::redirect "https://c[HTTP::uri]" }
}
Although you end up with 2 VS, I think this is a cleaner way to configure the F5 and it effectively restricts access to port 80 & 443 on the VS.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
