-
Notifications
You must be signed in to change notification settings - Fork 975
Blocking Bots on Your AVideo Platform
Daniel Neto edited this page Apr 3, 2024
·
1 revision
In an effort to enhance the security and performance of your AVideo platform, we provide a feature to block unwanted bots from accessing your site. This guide will walk you through how to enable bot blocking on your site by configuring the stopBotsList
and stopBotsWhiteList
parameters.
-
Access Configuration File:
- Navigate to your AVideo installation directory.
- Locate the
videos/configuration.php
file. This is where you'll add your bot blocking configurations.
-
Define Bots to Block:
- Within the
configuration.php
file, you need to specify which user agents (bots) you wish to block. - Add the
$global['stopBotsList']
array with values representing parts of the user agent strings of the bots you want to block.
Example:
$global['stopBotsList'] = array('headless', 'bot', 'spider', 'rouwler', 'Nuclei', 'MegaIndex', 'NetSystemsResearch', 'CensysInspect', 'slurp', 'crawler', 'curl', 'fetch', 'loader');
- Within the
-
Define Bots to Whitelist:
- In some cases, you might want to allow certain bots (e.g., search engine crawlers) to access your site for SEO purposes.
- Use the
$global['stopBotsWhiteList']
array to specify user agent strings for bots that should bypass the block.
Example:
$global['stopBotsWhiteList'] = array('facebook', 'google', 'bing', 'yahoo', 'yandex', 'twitter');
-
Save Your Changes:
- After adding the arrays to your
configuration.php
file, save your changes.
- After adding the arrays to your
- The script checks the
User-Agent
header of incoming requests against the list of bots you've defined in the$global['stopBotsList']
. - If a match is found, and the bot is not in the
$global['stopBotsWhiteList']
, the request is terminated, and a message "Bot Found" along with the bot's user agent is displayed. - Bots that are listed in the
stopBotsWhiteList
will be allowed access, overriding the block list.