Forum Discussion
Reginald_Sible1
Nimbostratus
Aug 16, 201980 443 redirect with Host redirect
I'm trying to create a 80 to 443 redirect for *.xyz-dev.com but in same rule i need if it comes in as a .net to redirect to a .com *.xyz-dev.net port 80 will redirect to *.xyz-dev.com port 443...
Lee_Sutcliffe
Nacreous
Aug 16, 2019Try this iRule
when HTTP_REQUEST {
if {[HTTP::host] contains ".xyz-dev"} {
switch -glob [HTTP::host] {
"*.net" {
HTTP::redirect https://[string map {"net" "com"} [HTTP::host]][HTTP::uri]
}
default {HTTP::redirect https://[HTTP::host][HTTP::uri]}
}
}
}
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