Forum Discussion
Sean_Lonning_29
Nimbostratus
Oct 31, 2017HTTP redirect to HTTPS and add domain but leave it off if already added
Two scenarios here.. user enters or
Getting to become is done with this part of the iRule
when HTTP_REQUEST {
if {([HTTP::host] contains "vipaddress")} then {
HTTP::...
Stanislas_Piro2
Cumulonimbus
Oct 31, 2017Hi,
why do you want to add if you know the expected result?
try this code:
when HTTP_REQUEST {
switch [HTTP::host] {
"vipaddress" -
"vipaddress.example.local" {
HTTP::redirect "https://vipaddress.example.local[HTTP::uri]"
}
}
}you can also try this:
when HTTP_REQUEST {
switch [HTTP::host] {
"vipaddress" -
"vipaddress.example.local" {
HTTP::redirect "https://[getfield [HTTP::host] "." 1].example.local[HTTP::uri]"
}
}
}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