- Log in to cPanel
- Go to File Manager
- At the top right, at Settings, click the button and select "Show Hidden Files (dotfiles)"
- Edit the .htaccess file
To block a single agent ex: Baiduspide, follow the steps below:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} Baiduspider [NC]
RewriteRule .* - [F,L]
To block more agents follow the steps below:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^.*(Baiduspider|HTTrack|Yandex).*$ [NC]
RewriteRule .* - [F,L]
- Save the .htaccess file
