Forum Discussion

Manuel_60430's avatar
Manuel_60430
Icon for Nimbostratus rankNimbostratus
Nov 16, 2016

http redirect iRule not working

I have a rather simple iRule which is not working as intended. Maybe someone with a programming background could tell me what I am doing wrong?

The rule needs to perform a redirect, except if the client IP is member of a specific group (data group list). Here is what I got so far

when HTTP_REQUEST {
 if { [string tolower [HTTP::host]] equals "something.mydomain.com" and not ([class match [IP::client_addr] equals EXCEPTION-LIST]) } {
 HTTP::redirect "https://somethingelse.domain.com/[HTTP::uri]"
 }
}

1 Reply

  • Hi Manuel, With a log.local0 statement check [IP::client_addr] like this:

     

    log local0. "--> [IP::client_addr]"

     

    may be there is a "%" statement (indicating the partition) that make unsuccesfull macth with data group.

     

    regards