BrowserMatchNoCase plus a Require expression. Works on shared hosting where you cannot edit the main config.
curl -s https://www.pathwren.workers.dev/snippet/apache-htaccess.txt -o .htaccess
# AI Crawler Index — Apache 2.4 (.htaccess)
# curl -s https://www.pathwren.workers.dev/snippet/apache-htaccess.txt
<IfModule mod_setenvif.c>
BrowserMatchNoCase "Bytespider" block_bot
BrowserMatchNoCase "TikTokSpider" block_bot
</IfModule>
<RequireAll>
Require all granted
Require not env block_bot
</RequireAll>