Forum Discussion
looking for an opinion on this https redirect irule
I 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 }
}
}
- Sokol_69126Jul 14, 2016
Nimbostratus
thank you for your answer! I neglected to note that https://www.placetwo.com/subplace/ is outside of this f5. In that case, I am forwarding it to the company that owns us. how would I adapt this to that case?
Thanks again!!!
- Vijay_EJul 14, 2016
Cirrus
The 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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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