Have you ever needed to have some files on your server available to the general public? Perhaps some useful downloads that you’ve created for your clients and potential clients? But, you don’t want everyone to be able to see the entire directory willy nilly.
Here’s how to prevent the whole directory from showing (called indexing of a directory) but still allow public access to files:
- First, open up a plain text document (notepad on a PC or TextEdit on a Mac)
- Copy and paste this little bit of html
- Save the file as index.html
- Upload this new index.html file to the folder that you want to prevent from being indexed, and voila! Done!
<p>Directory access is forbidden.</p>
A super simple solution.