SCOTT EVANS Mostly about pointing microphones at loud things.

Indices

Before and after screens. Click for a big version.

Before and after screens. Click for a big version.

Download (v1.1, sept 1 2009)

Apache’s default directory index pages are ugly. Indices is a set of hacks that makes them pretty, and more usable.

View a demo index here.

What it does

  • Simple, clean design
  • Easily customizable logo and link at the top
  • Optional readme.html file inserted before file list
  • Long filenames are visible
  • Directory names in bold; trailing slashes stripped from directory names
  • Nice file icons
  • Output is XHTML 1.0 Strict, styled with CSS
  • Should be easy to modify for your own needs

How it works

Unlike other PHP-based solutions, Indices is based on Apache’s built-in directory mechanism, so it’s pretty easy to seamlessly integrate it into your entire website.

Indices uses a few helpful Apache mod_autoindex directives, coupled with a bit of CSS and (optional) Javascript hackery. The README talks about installation and how everything works.

If you’re curious about the plumbing, read this blog post.

Requirements

I developed Indices for my web server, which runs Apache 2.0.x and PHP 5.1.x. It’ll probably require some tweaking to get it working with earlier versions of either.

If you’re running Apache 1, you’ll be able to use some of this code for inspiration, but you’ll need to do a lot more hackery.

Download

Download (v1.1, sept 1 2009)
4 comments

4 Comments so far

  1. Adrian January 12th, 2010 2:58 pm

    I love this as it’s very easy to use and is non-intrusive. Nicely done.

    Just a point about the README – it may be useful to add that if you are installing this to a directory that is not under the htdocs path using the Directory directive, you need to include the line:

    AllowOverride Indexes Options

    Thanks for sharing your excellent solution.

  2. Steve January 18th, 2010 10:25 am

    Is there anyway to specify folders or files to omit from the directory listing?

  3. gse January 18th, 2010 11:06 pm

    @Steve – That kind of thing should be done with Apache configuration; Indices’ purpose is to style Apache’s output.

  4. Steve January 25th, 2010 9:39 pm

    @gse – Thanks. I should have searched Google first. IndexIgnore is what I needed.

Leave a reply