Subsite ACL (Exception)

I have a working irule that blocks access to a subsite of a website based on a IP address. I would however like to add to the rule an exception url. for instance all access is blocked to /admin but i would like a folder behind /admin to be able to be accessed. Lets call that folder /upload.

Here is the iRule

when HTTP_REQUEST {

if { [class match [string tolower [HTTP::uri]] contains subsite] and ![class match [IP::client_addr] eq allow] } {

discard }

}

when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] contains subsite] and !([[string tolower [HTTP::uri]] contains "/admin/upload") and ![class match [IP::addr [IP::client_addr]] eq allow] } {
discard }
}

Should do it.

Hi Jason,

You could also provide some information to the clients when they are denied access

Here is the one modified from Chris’

when HTTP_REQUEST {
     if { [class match [string tolower [HTTP::uri]] contains subsite] and !([[string tolower [HTTP::uri]] contains "/admin/upload") and ![class match [IP::addr [IP::client_addr]] eq allow] }
       {
            HTTP::respond 200 content "Forbidden Redirect From Remote Server\Acess is forbidden" 
        }

}

I hope this helps

Bhattman