Name
AddIcon
Synopsis
AddIcon icon_name name
Server config, virtual host, directory, .htaccess
We can add visual sparkle to our page by giving
icons to the files with the
AddIcon
directive. Apache has more icons than you
can shake a stick at in its ... /icons
directory. Without spending some time exploring, one
doesn’t know precisely what each one looks like, but
bomb.gif will do for an example. The
icons directory needs to be specified relative
to the DocumentRoot
directory, so we have made a
subdirectory ... /htdocs/icons and copied
bomb.gif into it. We can attach the bomb icon to
all displayed .html files with this:
... AddIcon icons/bomb.gif .html
AddIcon
expects the URL of an icon, followed by a
file extension, wildcard expression, partial filename, or complete
filename to describe the files to which the icon will be added. We
can iconify subdirectories off the DocumentRoot
with ^^DIRECTORY^^
, or make blank lines format
properly with ^^BLANKICON^^
. Since we have the
convenient icons directory to practice with, we
can iconify it with this:
AddIcon /icons/burst.gif ^^DIRECTORY^^
Or we can make it disappear with this:
... IndexIgnore icons ...
Not all browsers can display icons. We can cater to those that cannot by providing a text alternative alongside the icon URL:
AddIcon ("DIR",/icons/burst.gif) ^^DIRECTORY^^
This line will print the word DIR
where the
burst icon would have appeared to mark a
directory (that is, the text is used as the ALT
description in the link to the icon). ...
Get Apache: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.