Forum Discussion
Irule for transparent redirect
Hi, I need an iRule for transparent redirect, basically I have VIP in legacy floor which needs to send partial traiffic to another VIP for example application 1 while they are migration all applications to new servers..
will below irule works? is this transparent to Clinets? I am going to aplly below iRule on legacy VIP.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri] ] {
"/app/*" {
HTTP::redirect “https://www.example.com[HTTP::uri]”
}
“/app2*” {
HTTP::redirect “https:://www.example .com[HTTP::uri]”
}
}
Please help.
thx
3 Replies
- Kevin_Stewart
Employee
The HTTP::redirect command is NOT transparent to clients. It will send a 302 redirect back to the client browser, changing the address bar. To transparently change the URI without the client seeing it, use the HTTP::uri command. - nitass
Employee
basically I have VIP in legacy floor which needs to send partial traiffic to another VIP for example application 1 while they are migration all applications to new servers.what is "another vip" indeed? is it another virtual server on the same or different bigip or something else?
if same, you may try "virtual" command.
virtual wiki
https://devcentral.f5.com/wiki/irules.virtual.ashx
if different, you may try "node" command.
node wiki
https://devcentral.f5.com/wiki/iRules.node.ashx - KJ_50941
Nimbostratus
another VIP is The VIP on different F5 in SAT envirornmnet. Can you tell me what is going to be actual iRule?
will this work?
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri] ] {
"/app/*" {
HTTP::uri “https://www.example.com[HTTP::uri]”
}
“/app2*” {
HTTP::uri “https:://www.example .com[HTTP::uri]”
}
}
thx
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