Forum Discussion
Faruk_AYDIN
Mar 09, 2016Nimbostratus
to do list we add secodary URL for each country. firstly, modify iRule like that:
when HTTP_REQUEST { set countryCode [whereis [IP::client_addr]] if {[HTTP::uri] contains "pid=search"} { append countryCode "2" } set redir [class match -value -- $countryCode contains country-redirect] if { $redir ne "" } { HTTP::redirect $redir } else { HTTP::redirect "http://default.example.com/" } }
add a secodary url for each country in the data group:
ltm data-group internal country-redirect { records { AU { data http://www.example1.com/ } AU2 { data http://www2.example1.com/ } CR { data http://www.example2.com/ } CR2 { data http://www2.example2.com/ } MX { data http://www.example2.com/ } MX2 { data http://www2.example2.com/ } UK { data http://www.example1.com/ } UK2 { data http://www2.example1.com/ } US { data http://www.example1.com/ } US2 { data http://www2.example1.com/ } } type string }