Forum Discussion
Kevin_Pruett_73
Nimbostratus
May 12, 2014irule for redirect https to https v9
I am looking for assistance with irule structure/ syntax. We are trying to create an irule that will take an https host name and append a www in front of it. For example https://dog.food.com -> http...
Kevin_Pruett_73
Nimbostratus
May 12, 2014Better format and syntax correction..my apologies.
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] == "dog.food.com"} {
HTTP::redirect https://www.dog.food.com[HTTP::uri]
}
if {[string tolower [HTTP::host]] == "dog2.food.com"} {
HTTP::redirect https://www.dog2.food.com[HTTP::uri]
}
if {[HTTP::header exists "Cookie"]} {
if {[HTTP::cookie exists "F5SSLISBEINGUSED"]} {
HTTP::cookie remove "F5SSLISBEINGUSED"
}
set current_cookies [HTTP::header "Cookie"]
HTTP::header replace "Cookie" "$current_cookies; F5SSLISBEINGUSED=ON"
} else {
HTTP::header replace "Cookie" "F5SSLISBEINGUSED=ON"
}
}
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