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...
ekaleido_26616
Cirrocumulus
Jul 14, 2016I am assumig you don't want to actually redirect them to the URL/URI they originally requested, so rather than redirect, I made the action to simply send the traffic to the relevant pool name. In this example, a pool named "whatever." Using switch will allow you to expand the concept should you require other redirects later.
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if { $host = "www.placeone.com" || "placeone.com" } {
switch [HTTP::uri] {
"/" { HTTP::respond 301 Location "https://www.placetwo.com/subplace/" }
default { pool whatever }
}
}
Vijay_E
Cirrus
Jul 14, 2016The above iRule should work in terms of sending a redirect to the client and the client will initiate the connection again to the new location.
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