Block word by firewall but allow access in another folder

Hello, I need your wise help…?
It turns out that my site gets a lot…a lot of “hits” from bots to a particular folder called “admin” at the root of my site.
Roughly 400,000 or more a day in that single folder.
There is no folder or file named like that at the root of the site. I have created a firewall rule to block everything that reaches the “word” “admin”, it works perfectly. But within the site there is a folder called “mainaccess” and indeed I have files that contain the word “admin” and of course access is blocked by the firewall.
My question…is there a way to create a rule that blocks everything that goes into “admin” in the root, but leaves free access to the “mainaccess” folder while allowing all other “admin…”
It’s not possible for me to change every single file name since we’re talking about many… that’s why I want to block “visits” to admin only from root.

Thank you all in advance.

If you are on a Free or Pro Plan, you can try a Firewall Rule with the following condition:

If URI Full contains example.com/admin/ then Block/Challenge.

If you are on a Business or Enterprise Plan, you can use URI Path and use a Regular Expression to match the beginning of the path.

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.