Pennf0lio
Pennf0lio

Reputation: 3894

What are the downside of not having an index.html file to some directories

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!

Upvotes: 0

Views: 127

Answers (1)

kemiller2002
kemiller2002

Reputation: 115508

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.

Upvotes: 2

Related Questions