Forum Discussion
abdullah_alshah
Nimbostratus
Oct 12, 2017multi-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?
1 Reply
- Andy_McGrath
Cumulonimbus
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]" } } } }
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