i have a Magento website working with Apache2 and every day i get bots crawling urls that i do not want to and i would like to return 429 for specific urls.
i have tried this in my htaccess
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (Yahoo!\Slurp|semrushbot) [NC]
Redirect 429 /shop/ricerca/
</ifModule>
where my bots are:
yahoo slurp googlebot yandex semrush etc
and path to protect are:
/path/toprotect/
/path/to/protect2/
tailing access logs seems my snippet is not working.
any one can help me?
eventually if too messy, i'll just use nginx as reverse proxy and filter bots from there where i have more experience