Forum Discussion
Sokol_69126
Nimbostratus
Jul 14, 2016looking for an opinion on this https redirect irule
Hey Everybody, I wonder if I can get your opinion on my irule.
I am tasked with creating an http to https redirect but at the same time they would like to make some tweaks for SEO reasons. we ar...
VernonWells
Employee
Jul 14, 2016I believe the following is clearer and it avoids multiple expansions of
string to lower [HTTP::host]:
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" } {
switch [string tolower [HTTP::host]] {
"placeone.com" -
"www.placeone.com" {
HTTP::respond 301 Location "https://www.placetwo.com/subplace/"
return
}
}
}
HTTP::respond 301 Location "https://www.placeone.com[HTTP::uri]"
}
You may also consider using a Local Traffic Policy. This is particularly true if you are running 12.x.
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