.htaccess is a configuration file of the Apache web server, it allows you to set a large number of additional parameters and permissions for the web server in individual directories (folders), such as controlling access to directories and files, reassigning file types, specifying encoding, etc., without changing the main configuration file.
The .htaccess file is read by the Apache web server each time it is accessed, so any change is effective immediately.
Example of using .htaccess file when blocking bad bots.
If you use this setting, the page will give 403 to badbot, badbot1:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (badbot|badbot1) [NC]
RewriteRule .* - [R=403,L]
Notations:
NC - no case - under no circumstances.
L - last rule.
OR - or.
Example:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} (SemrushBot|MJ12bot|AhrefsBot|AspiegelBot|DotBot|LinkpadBot|SputnikBot|statdom.ru|MegaIndex.ru|WebDataStats|Jooblebot|Baiduspider|BackupLand|NetcraftSurveyAgent) [NC].
RewriteRule ^.* - [F,L]
If you have any difficulties or have additional questions, you can always contact our support team via ticket system.