More specifically, I have an htaccess file that restricts anyone from seeing the directory contents. Such that, nobody can see my 1000s of images in www.example.com/images by us
You do not need to create an index file like this-
Forbidden!
Access Denied !!
And place it in each resource directories and directories you don't want to show users.
You can just add this at the end of your .htaccess file-
Options -Indexes
So, your .htaccess file may be like this-
Options -MultiViews
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
Options -Indexes
If you do that and try to go to a directory, you would get something like this-
So, no one will be able to discover any directory in server.
More can be found here.