特定のボットが Web サイトの特定のディレクトリにアクセスできないようにする必要があります。これは、ブロックする各フォルダーに異なる .htaccess ファイルを作成したくないことを除いて、この質問とほぼ同じです。ルート .htaccess ファイルを使用する必要があります。
正規表現は本当に苦労しました。あなたの助けに感謝
フォルダのリストを作成し、各フォルダの前に同じ条件を追加するだけです:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|Baiduspider) [NC]
RewriteRule ^folder1/ - [L,F]
RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|Baiduspider) [NC]
RewriteRule ^folder2/anotherfolder/ - [L,F]
RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|Baiduspider) [NC]
RewriteRule ^folder3/path/to/disallowedfolder/ - [L,F]
等..