views:

36

answers:

1

Hi,

I'm curious what are some effects/downside of not putting an index.html file to your directories (e.g images). I know when an index file is not present to a directory, files inside that directory are no longer private and will be visible to the browsers when point (eg yoursite.com/images/). Aside from that what are some big effects to consider? and how to properly secure them.

thanks!

+2  A: 

This depends on your web server, but there are two disadvantages to not having one.

  1. If not secured, some web servers will show the directory contents if there is no default page.
  2. If someone types your_site/directory/, and there is no default page, they will receive a 404 error.

With current web servers, there are many ways to get around not having a default page for each directory. You can set the custom 404 to redirect to a page that is available, and some can put one in automatically for you. As far as security goes, you can just turn off directory browsing to not allow people to see the contents.

If you are configuring your own server, not having one becomes less of an issue since you can control how the server responds to such situations. People normally just put it in as a fail safe, to make sure that the above two problems are taken care of.

Kevin
Won't it return 403 error in case 2 (if directory index is disabled on the web server)?
a1ex07