Often, it is recommended to prevent visitors from viewing the contents of your website directories. Just remember security through obscurity. If a visitor is not able to view which files are there in a web directory, it would be a little difficult to hack the website. Use the following command for preventing directory listing on a website:
Options -Indexes
Reference: https://www.thesitewizard.com/apache/prevent-directory-listing-htaccess.shtml