Forum Discussion

jt_47643's avatar
jt_47643
Icon for Nimbostratus rankNimbostratus
Mar 04, 2008

irule appears to be matching on more than expected

What we are trying to do:

 

We wish to block a portion of our web site from anyone not coming from a particular IP.

 

 

This is the code we thought would work:

 

 

if (client_addr != 172.20.49.100 and http_uri starts_with "/cn/")

 

{ redirect to "http://qa-rev-wlc.combinenet.com" }

 

else

 

{ use pool qa-rev-wlc }

 

 

What we think we are seeing blocked:

 

 

URIs like: /company/images/CN_Upper_Logo.png

 

 

possibly matching on the /CN portion of the URI.

 

 

We are running 4.5.14

 

 

Thanks for the help,

 

 

Jt
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi,

     

     

    Could the problem be that the client IP address isn't what you're expecting?

     

     

    If you send a request for http://example.com/company/images/CN_Upper_Logo.png, do you get redirected? If so, I'd be surprised--I thought the starts_with operator did a string comparison and that it was case sensitive. If that's really happening, can you try escaping the forward slashes with backslashes?

     

     

    if (client_addr != 172.20.49.100 and http_uri starts_with "\/cn\/")

     

     

    Aaron