W3C httpd manual

Icons In The Directory Listings

W3C httpd directory icons are used, if enabled, for both regular directory listings, and FTP listings (when runnins as a proxy).

These directives are specified in the configuration file.


If the standard icons are not located under server ServerRoot but maybe on another server this directive can be used to define the location. An example is:
	IconPath	http://new.icon.server:8080/httpd-internal-icons/


The AddIconToStd directive behaves exactly as the AddIcon directive in that it allows to add an icon definition for a certain MIME-type. However, it does not disable the initialization of the standard icons but makes an extension to these ones.


The AddIcon directive binds an icon to a MIME Content-Type or Content-Encoding:
        AddIcon  icon-url ALT-text template
is the URL of the icon.

is the alternative text to use on character terminal browsers.

is either a Content-Type template or a Content-Encoding template. Content-Type template must always contain a slash, whereas Content-Encoding template never has it.

The following important remarks serve also as examples.

VERY IMPORTANT: W3C httpd as a Normal HTTP Server

Understand that the icon-url is a virtual URL - one that will be translated through the rules. Therefore you must make sure that your configuration rules allow the icon URLs to be passed, e.g.:
    AddIcon  /icons/UNKNOWN.gif  ???  */*
    AddIcon  /icons/TEXT.gif     TXT  text/*
    AddIcon  /icons/IMAGE.gif    IMG  image/*
    AddIcon  /icons/SOUND.gif    AU   audio/*
    AddIcon  /icons/MOVIE.gif    MOV  video/*
    AddIcon  /icons/PS.gif       PS   application/postscript
    Pass /icons/*  /absolute/icon/dir/*
    ...other rules...

VERY IMPORTANT: W3C httpd as a Proxy

When using httpd as a proxy the icon URL must be an absolute URL pointing to your server; otherwise clients would translate it relative to the remote host.

Furthermore, you must have a mapping from this absolute URL to your local file system, e.g.:

    AddIcon  http://your.server/icons/UNKNOWN.gif  ???  */*
    AddIcon  http://your.server/icons/TEXT.gif     TXT  text/*
    AddIcon  http://your.server/icons/IMAGE.gif    IMG  image/*
    AddIcon  http://your.server/icons/SOUND.gif    AU   audio/*
    AddIcon  http://your.server/icons/MOVIE.gif    MOV  video/*
    AddIcon  http://your.server/icons/PS.gif       PS   application/postscript

    Pass http://your.server/icons/*  /absolute/icon/dir/*
    Pass /icons/*                    /absolute/icon/dir/*
    Pass http:*
    Pass ftp:*
    Pass gopher:*
NOTE: Both the full and partial icon URLs are Pass'ed because smart clients may be configured to connect to local servers directly, instead of through the proxy, and in that case the proxy server (which is then just a normal HTTP server from client's point of view) will be requested for /icons/... instead of http://your.server/icons/.... The proxy server has no way of knowing which will happen.

Icons in Gopher Listings

There are special internal (to httpd) MIME content types that can be bound to icons for gopher listings (the names should be self-explanatory):

Special Icons

httpd needs some special icons:
Icon URL used in the heading of the listing to align it. This is typically a blank icon, but may contain some nice image that you wish to have on top of all your listings. The only criterion is that it must be the same size as the other icons.

Icon URL used for unknown file types, i.e. files for which no other icon binding applies. If you have an exhaustive set of AddIcon directives this needs not be used.

Icon URL for directories.

Icon URL for parent directory.

Example For a Regular HTTP Server

IMPORTANT: Remember to Pass the icon URLs!

        AddBlankIcon    /icons/BLANK.gif
        AddUnknownIcon  /icons/UNKNOWN.gif  ???
        AddDirIcon      /icons/DIR.gif      DIR
        AddParentIcon   /icons/PARENT.gif   UP

	Pass  /icons/*  /absolute/icon/dir/*
        ...other rules...

Example For a Proxy Server

IMPORTANT: Icon URLs must be absolute URLs, and you must have a mapping from the absolute form to local form, and remember to Pass them:
        AddBlankIcon    http://your.server/icons/BLANK.gif
        AddUnknownIcon  http://your.server/icons/UNKNOWN.gif  ???
        AddDirIcon      http://your.server/icons/DIR.gif      DIR
        AddParentIcon   http://your.server/icons/PARENT.gif   UP

        Pass http://your.server/icons/*  /absolute/icon/dir/*
        Pass /icons/*                    /absolute/icon/dir/*
        Pass  http:*
        Pass  ftp:*
        Pass  gopher:*

httpd@w3.org, July 1995