Title photo
frugal technology, simple living and guerrilla large-appliance repair
Sun, 13 Apr 2014

Hiding directories in Apache with .htaccess

In my Ode system running on an Apache web server, I'm "exposing" the existence of the /documents directory by stashing HTML there for my site archive.

Normally only text files and images live in that directory, and Ode uses them to produce the HTML pages it serves out of another directory.

I'm not crazy about exposing the contents of directories that don't, for the most part, serve HTML. So I decided to disallow directory listings on my Ode site with this line in .htaccess:

Options -Indexes

Now my readers can see http://stevenrosenberg.net/documents/archive.html but not http://stevenrosenberg.net/documents and the entire structure under that.

Even if I do decide to move my archive file to another directory (and I am seriously thinking about doing that), it still seems like a good idea to block access to the "raw" directories in Apache.