Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

multi-able ports and urls

dears please help on below with iRule, I have 5 URLs(ex. sf.stc.com/dd.stc.com/bo.stc.com/tt.stc.com/mm.stc.com) with 5 defrent ports(85.86.87.88.89) and one VS.when I request: sf.stc.com it should redirect me to sf.stc.com:85 dd.stc.com it should redirect me to sf.stc.com:86 bo.stc.com it should redirect me to sf.stc.com:87 tt.stc.com it should redirect me to sf.stc.com:88 mm.stc.com it should redirect me to sf.stc.com:89

how I can do that by using iRule?

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Not tested but try this:

when HTTP_REQUEST {
    if {server_port < 84 || server_port > 84} {
        switch [HTTP::host] {
            "sf.stc.com" {
                HTTP::redirect "http://[HTTP::host]:85[HTTP::uri]"
            }
            "dd.stc.com" {
                HTTP::redirect "http://[HTTP::host]:86[HTTP::uri]"
            }
            "bo.stc.com" {
                HTTP::redirect "http://[HTTP::host]:87[HTTP::uri]"
            }
            "tt.stc.com" {
                HTTP::redirect "http://[HTTP::host]:88[HTTP::uri]"
            }
            "mm.stc.com" {
                HTTP::redirect "http://[HTTP::host]:89[HTTP::uri]"
            }
        }
    }
}
0
Comments on this Answer
Comment made 1 week ago by abdullah alshahrani 2

plz check below error: Image Text

0