Forum Discussion
Vaibhav_02_1646
Nimbostratus
Jul 23, 2014irule for redirect multiple url of single VIP to other VIP
We are planning to migrate our application from abc.com to xyz.com
we have one VIP where we are running [test,test1,test2].abc.com I want to write a i-rule so we can redirect to [test,test1,test2].xyz.com
3 Replies
- Vaibhav_02_1646
Nimbostratus
rule rules { when HTTP_REQUEST { set host [string tolower [HTTP::host]] if {$host ends_with "abc.com"} { HTTP::redirect "https://[string map {"abc.com" "xyz.com"} $host][HTTP::uri]" } } }
Will this work?
- Kevin_Stewart
Employee
You can save a step this way:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] ends_with "abc.com" } { HTTP::redirect "https://[string map -nocase {"abc.com" "xyz.com"} [HTTP::host]][HTTP::uri]" } } - Vaibhav_02_1646
Nimbostratus
ok thanks Kevin. I will try that.!!
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