Chapter 6. Handling directories
them in directory listings. The auto-indexing module provides a slew of commands
for this purpose. The trick to producing self-consistent indexes is to use as few as
possible. We will set up distinct icons for the following entries.
Categories with distinct icons
• HTML web pages
• Plain text pages
• Any other “text” format
• Any image format
• Any audio format
• Any movie format
• PostScript
• Portable Document Format (PDF)
• Any other file content type
• Subdirectories
• The parent directory
The command that associates an icon with a MIME content type is AddIconByType.
However, we will also specify the ALT text for text-based browsers with the analo-
gous AddAltByType command.
AddIconByType /icons/layout.gif text/html
AddIconByType /icons/text.gif text/plain
AddIconByType /icons/generic.gif text/*
AddIconByType /icons/image2.gif image/*
AddIconByType /icons/sound1.gif audio/*
AddIconByType /icons/movie.gif video/*
AddIconByType /icons/ps.gif application/postscript
AddIconByType /icons/pdf.gif application/pdf
DefaultIcon /icons/ball.gray.gif
AddAltByType "HTML file" text/html
AddAltByType "Plain text" text/plain
AddAltByType "Text" text/*
AddAltByType "Static image" image/*
AddAltByType "Audio" audio/*
AddAltByType "Video" video/*
AddAltByType "PostScript" application/postscript
AddAltByType "PDF" application/pdf
Figure 6-24. Specifying icons for MIME content types
Note: Normally I would recommend using the PNG icons rather than the GIF icons to
avoid possible future patent problems with Unisys. However, whoever did the conversion
got the background transparency wrong and you should use the GIF icons for the time
being until the PNGs are fixed.
We still have a problem with directories. There is no MIME content type for a di-
rectory so we must use other facilities. The following is a filthy hack introduced by
Apache version 1 and preserved into version 2.
43
Commenti su questo manuale