Forum Discussion
Tyranon_113005
Nimbostratus
Aug 28, 2018[iRules]redirect to other site or pool
Hi,
I'm trying redirect by host name.
When the access http://aaa.com, redirect to https://bbb.com
When the access https://bbb.com, just through to pool related to VS bbb.com.
I set like ...
jaikumar_f5
Noctilucent
Aug 28, 2018Hi Tyranon,
Try the below,
when HTTP_REQUEST {
if { [HTTP::host] equals "aaa.com" } {
HTTP::redirect "https://bbb.com[HTTP::uri]"
} elseif { [HTTP::host] equals "bbb.com" } {
pool bbb.com
}
}
BTW if your VS already has the default pool which is bbb.com, you dont need the elseif condition, because the host is ultimately going to be bbb.com and it would just process the traffic and send to the VS pool, so below irule can be used too,
when HTTP_REQUEST {
if { [HTTP::host] equals "aaa.com" } {
HTTP::redirect "https://bbb.com[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