Hi Yozzer,
Remove the elseif statement and the return.
You won't need either. If they qualify the the first event they will be redirected, if not then they will be caught by the else statement and also be redirected (in this case to the same location, but I am assuming that you sanitized the iRule to post it).
A
return statement is only used when there is an event triggered in an iRule and you do something and you do not want any further iRule processing. The return statement will break out and not process any further conditions in the iRule.
Try this:
when HTTP_REQUEST {
set name "DC"
if {([string tolower [HTTP::method]] eq "get") && ([string tolower [HTTP::uri]] eq "/") && ([string tolower [HTTP::header "Referer"]] ne "http://cba.com") } {
if {([string tolower [HTTP::cookie value $name]] contains "session=&") } {
HTTP::redirect "http://www.abc.com"
}
else {
HTTP::redirect "http://www.abc.com"
}
}
}
Hope this helps.