I am trying to prevent a bot from accessing certain file extension within a public directory on our server. We use Apache and I wish to apply a .htaccess rule to prevent the bot from being able to access that particular extension file type from the directory. I tried looking for a snippet related to this but could not find one.
We are right now using the following code to prevent the bot from accessing the directory. The following .htaccess is placed in that particular directory.
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} BotName [NC]
RewriteRule ^ - [R=403,L]
Now we wish to ensure that the bot is able to access the directory but not certain files (file extension type) in the directory.