To block direct access to a directory, just add a rewrite rule at vhost level like
RewriteCond %{REQUEST_URI} ^/blocked/uri/
RewriteRule ^/blocked/uri/ - [R=403,F]
REQUEST_URI is the same as the current URI when accessing the file directly, however, when a request was internally redirected, Current URI is the "/blocked/uri/", while REQUEST_URI is the URI in the original request header.