FaresB
Apr 22, 2020Nimbostratus
Blocking an URI wildcard to a specific Hostname and using an header
Hi,
I'm trying to block wildcard " /* "but I need to allow access to " /pathA/* " and " /pathB/* " from a specific hostname, I need also to block these paths in the "Referer" header.
Basically, every access to " /* " should be rejected exept paths containing keyworld "pathA" and "pathB".
I have tried this iRULE but it seems to not work:
when HTTP_REQUEST {
if { ([string tolower [HTTP::host]] contains "myhostname.society.com") && (![HTTP::uri] contains "/pathA" || ![HTTP::uri] contains "/pathB")} {
HTTP::respond 403
}
elseif { ((![HTTP::header "Referer"] contains "/pathA") || (![HTTP::header "Referer"] contains "/pathB")) }
{
HTTP::respond 403
}
}
Can you help me ?
regards