Q:

if URI is directory, return 403 forbidden in htaccess

In my htaccess file, i want to respond with a http 403 code if users attempt to access a directory, however if they attempt to access a file, allow. How is this done?

A:

Turn off the Indexes option. Directory listing pages will only be supplied if it is turned on.

