RewriteRule in Apache .htaccess is a convenient way to block directory access to a directory in your Apache document root. This can be useful to avoid accidental access to some content in these directories. Here is the config you can use in .htaccess in the desired directory.
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^.* - [R=404,L] </IfModule>
Here is how the a page having blocked directory looks like in Chrome. We are using directory _internal just for the purpose of this tutorial.