Help on a irule
Hello Everybody, i'm a newbie in irules and need some help in order to change an old irule to something simple and i'm don't know if i'm doing it right.
Original Irule ( when i put up on V11 i got a few error messages)
when HTTP_REQUEST { set url_var text([HTTP::host])
if { $url_var contains "sitea.test.com" } { HTTP::redirect "sitec.test.com/index" } if { $url_var contains "siteb.test.com" } { HTTP::redirect "http://test3.test.com/test" }
if { $url_var contains "sitec.test.com" } { HTTP::redirect "http://test3.test.com/login" } } }
I've tried to use the following irule but i'm getting errors anyway.
when HTTP_REQUEST { if {[string tolower [HTTP::host]] contains "sitea.test.com" { HTTP::redirect "http://sitec.test.com/index"} if {[string tolower [HTTP::host]] contains "siteb.test.com" { HTTP::redirect "http://test3.test.com/test"} if {[string tolower [HTTP::host]] contains "sitec.test.com" { HTTP::redirect "http://test3.test.com/login"}
Am i doing something wrong? Can someone point out the best way to do these redirects?
Thanks!