DIEthumb

Quick Tip: Prevent listing of files in your site’s sub-directories

If you are using Apache web server chances are that it is configured by default to show an index of available files in a directory if the standard index files; index.php or index.html are not available in that particular directory.

To avoid such behavior and prevent listing of files in a sub-directory of your site, you can of course configure Apache using .htaccess rules but there is an extremely simple solution that works just as well.

Simply create a blank index.php or index.html file and place it in your directory that you do not want other people (read creepy developers) to know all the contents of! It works very well. This way now when a user tries to access the sub-directory, he will be shown a blank page instead of the index of files and folders!

Some situations where you can use this is to hide the contents of a folder that contains downloadable goodies, or some directory that contains precious scripts that you don’t want everyone to see.

Mujtaba

I am a student of Computer Engineering and a freelance web designer and developer with a passion for interface design. WordPress is my framework of choice and I also build web and mobile applications. My Google+ Profile

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2015 All rights reserved | Powered by WordPress
Back to top ↑
Theme by dynamicguru.com