Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


A few tips | 14 comments | Create New Account
Click here to return to the 'A few tips' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A few tips
Authored by: androse on Nov 08, '02 09:35:09AM

I played around with this a couple of weeks ago, here is what I found out :

The directory listing capabilities of Apache is handled by the mod_autoindex module. You can change more than the icons, you can for exemple :


  • change the 'header' of the HTML output with the
    HeaderName
    directive.
  • reorder the elements with a 'natural order' algorithm (for exemple: "a, B, c, D" and not "B, D, a, c") with the
    IgnoreCase
    directive.
  • list all folders first with the
    FoldersFirst
    directive.
  • set the width in characters for description and name columns with the
    DescriptionWidth=XX, NameWidth=XX
    directive.
  • etc...


You can see an example of what I got at the end.


There are my httpd.conf options :


IndexOptions FancyIndexing
IndexOptions ScanHTMLTitles
IndexOptions SuppressHTMLPreamble
IndexOptions IconsAreLinks
IndexOptions NameWidth=*
IndexOptions DescriptionWidth=25
IndexOptions IgnoreCase

AddIconByType (TXT,/icons/IDS_texte.gif) text/*
AddIconByType (IMG,/icons/IDS_image.gif) image/*
AddIconByType (SND,/icons/IDS_audio.gif) audio/*
AddIconByType (VID,/icons/IDS_video.gif) video/*
AddIcon /icons/IDS_parent.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/IDS_directory.gif ^^DIRECTORY^^
AddIcon /icons/IDS_blank.gif ^^BLANKICON^^
DefaultIcon /icons/IDS_default.gif

HeaderName /icons/headerAutoIndex



In a nutshell, you cannot change the HTML output of the file listing itself (with a template for example), but you can change the header and footer, so you can add a CSS, Javascript (who would need that ?), etc. Redesigning the icons is a must :)
Good luck.

[
Reply to This | # ]