To prevent someone from accessing a sub-folder on Apache webserver you can simply add or modify a .htaccess file.

Simply put the following into an .htaccess to prevent web access to all files in folder and below.

1
deny from all