Theming Apache's mod_autoindex directory listing
Posted on January 30, 2015 • 1 minutes • 187 words
By default, your shared folder with mod_autoindex
enabled looks like this.
The icons looks like they were from Windows 3.1 era. I am by no mean a designer but looking at this seriously make me want to vomit.
I decided to take a quick look at mod_autoindex
’s documentation
and grab some free icons from Dribbble to make it better.
Turns out, it’s easier than I thought. Theming is supported out-of-the-box with mod_autoindex
. I just have to copy some icons (frequently used file types) and add a few lines in my Apache’s vhost config. I can even inject CSS too. Every element already has proper id and class so I can just inspect the page and customize to my liking.
IndexIgnore /_theme # hide _theme folder
AddIcon /_theme/icons/blank.png ^^BLANKICON^^
AddIcon /_theme/icons/folder.png ^^DIRECTORY^^
AddIcon /_theme/icons/upper_level_directory_icon.png ..
AddIcon /_theme/icons/image.png .png .jpeg .gif .jpg
DefaultIcon /_theme/icons/fallback_icon.png
IndexStyleSheet "/_theme/style.css" # injecting CSS
HeaderName /_theme/header.html # customize header
ReadmeName /_theme/footer.html # footer
Here’s how mine looks like after.
If you’re too lazy for this stuff and just want a decent looking theme, take a look at Apaxy . Follow the installation instruction there.