Herself's Webtools

Scripts, HowTos, Templates, Plugins, Widgets, Tips and Useful Information

Are your directories showing?

without comments

Have you ever gone to a website and gotten a file listing instead of webpage? That’s not something you want happening. First it confuses your visitors, second no one should be viewing your directories for security reasons.

To prevent directory viewing you can stick a index.html file in each directory. Perhaps just a list of links pointing your visitor to the main sections of your website.

Or you can edit your .htaccess file and add

Options -Indexes

This will return a 403 error to the visitor.

Or you can edit your .htaccess file and add

DirectoryIndex missing.html

Then when a user tries to view a directory your ‘missing.html’ file will be shown. You can chose any file you want it doesn’t have to be missing.html.

See also:
Perishable Press Stupid htaccess tricks

Written by timestocome

November 26th, 2007 at 5:00 am

Posted in how to, security

Leave a Reply

You must be logged in to post a comment.