Styling Apache Indexes

The default output of Apaches Options +Indexes doesn’t look good at all. Very 1990 something… But - as with pretty much any open source open source software - there are tons of options, which enable you to change everything to your likings!

The contents of .htaccess

    # default order: descending by name
    IndexOrderDefault Descending Name
    # set the following options:
    # - ignore case
    # - don't display the description column
    # - display folders first
    # - set the width of the name column to 40 chars
    # - don't display the default HTML output (doctype, head, ..., starting <body> tag)
    # - use Fancy Indexing
    # - set IconHeight und Width to 16 pixels (FamFams Icons use these dimensions)
    IndexOptions +IgnoreCase +SuppressDescription +FoldersFirst +NameWidth=40 +SuppressHTMLPreamble +FancyIndexing +IconHeight=16 +IconWidth=16
    # we want to use indexes for this folder!
    Options +Indexes
    # the header template, which is displayed before the list
    HeaderName ../list_header.html
    # the footer template, which is displayed after the list
    ReadmeName ../list_footer.html
    # don't display the link to the root folder
    IndexIgnore ..
    # set the default icon to a fancy famfam icon
    DefaultIcon ../images/bricks.png

To see it in action visit the Typogridder download folder. Also take a look at the header template and the footer template.

Note: The icons I use are created by Mark James. Kudos and thanks go to him, for creating such beautiful and free icons!

Going Further

If you want to see what more is possible to do with apache, take a look at the following sites:


Want to comment? Send me an email!

Comment by Diego (not verified) (2013-02-13 13:50:00)

Thank you very much for sharing this! It was exactly what I was looking for.

Published on February 13, 2013.