Your iRule is almost correct but logic needs to be change from OR to AND:
when HTTP_REQUEST {
if {[matchclass [string tolower [HTTP::uri]] contains Allowed_uri] and [matchclass [IP::client_addr] equals Allowed_IP]} {
return
} else {
log local0. "---CLIENT IP---[IP::client_addr] URI is [HTTP::uri]"
drop
}
}
reversing the logic, like MrPlastic has done, you can do the same with less using not and logic OR:
when HTTP_REQUEST {
if {(not [matchclass [string tolower [HTTP::uri]] contains Allowed_uri]) or (not [matchclass [IP::client_addr] equals Allowed_IP])} {
log local0. "---CLIENT IP---[IP::client_addr] URI is [HTTP::uri]"
drop
}
}