You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to block an User-Agent which is listed as "good" in globalblacklist.conf
However when I add it to blacklist-user-agents.conf it is not blocked.
Steps to reproduce:
add this line to blacklist-user-agents.conf:
BrowserMatchNoCase "\bApplebot\b" bad_bot
(Applebot is a "good bot" in globalblacklist.conf)
Restart apache
Try:
curl -A "Applebot" https://yoursite.net
Expected:
403 Forbidden
Actually:
The HTML page is returned normally
I am using version Apache_2.4
I also tried this syntax and it did not work as well
BrowserMatchNoCase "(?:\b)Applebot(?:\b)" bad_bot
If I block other User-Agents not white-listed in globalblacklist.conf it works as expected and blocked
Your documentation in blacklist-user-agents.conf says:
# Please note this include file loads first before any of the already whitelisted User-Agents
# in the bad bot blocker. By loading first in line it over-rides anything below it so for instance
# if you want to block Baidu, Google or Bing for any reason you add them to this file which loads
# first and takes precedence over anything below it. This now allows even finer control over the
# bad bot blocker. Enjoy !!!
I see that actually blacklist-user-agents.conf is included after, not before white listing in globalblacklist.conf
I've also tried to change globalblacklist.conf and include blacklist-user-agents.conf first and it still does not work.
How do I block an User-Agent white-listed in globalblacklist.conf?
Server :
OS: Ubuntu
Apache Version
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2024-04-10T17:45:18
The text was updated successfully, but these errors were encountered:
It seems that the variable "good_bot," which was set using "BrowserMatchNoCase," cannot simply be overwritten again with "BrowserMatchNoCase."
I was able to solve this by removing the "good_bot" variable with
SetEnvIfNoCase User-Agent "\b$BOTNAME\b" !good_bot
and then resetting it with
BrowserMatchNoCase "\b$BOTNAME\b" bad_bot.
Here is an example from my blacklist-user-agents.conf with the YandexBot:
# Removing the "good_bot" flag and setting the "bad_bot" flag.
# -----------------------------
SetEnvIfNoCase User-Agent "\bYandexBot\b" !good_bot
BrowserMatchNoCase "\bYandexBot\b" bad_bot
# -----------------------------
I want to block an User-Agent which is listed as "good" in globalblacklist.conf
However when I add it to blacklist-user-agents.conf it is not blocked.
Steps to reproduce:
(Applebot is a "good bot" in globalblacklist.conf)
Restart apache
Try:
Expected:
403 Forbidden
Actually:
The HTML page is returned normally
I am using version Apache_2.4
I also tried this syntax and it did not work as well
BrowserMatchNoCase "(?:\b)Applebot(?:\b)" bad_bot
If I block other User-Agents not white-listed in globalblacklist.conf it works as expected and blocked
Your documentation in blacklist-user-agents.conf says:
I see that actually blacklist-user-agents.conf is included after, not before white listing in globalblacklist.conf
I've also tried to change globalblacklist.conf and include blacklist-user-agents.conf first and it still does not work.
How do I block an User-Agent white-listed in globalblacklist.conf?
Server :
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2024-04-10T17:45:18
The text was updated successfully, but these errors were encountered: