Forum Discussion
Ashu_2116
Nimbostratus
Jun 26, 2018i_rule help
We have 5 urls mapped to one IP (VS) under different LB pools & all are working on http. So if request is http://abc.com it redirects to its respective LB pool. one out of 5 url is moving to https no...
crodriguez
Jun 26, 2018Ret. Employee
I would make the code after the redirect an "else" condition on the IF. For example:
when HTTP_REQUEST {
if { [string tolower [HTTP::host] equals "abc.com" } {
HTTP::respond 301 Location "https://abc.com[HTTP::uri]"
} else {
switch -glob [string tolower [HTTP::host]] {
"xyz.com" { pool pool_xyz.com }
default { pool pool_jkl.com }
}
}
}Other than that, the fact that the variable named uri does not appear to be used anywhere after it is set in your example, and there are only two checks for host name (if it is not abc.com) on the SWITCH rather than four, your code appears to be OK.
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
