O'Reilly logo

Apache: The Definitive Guide, Second Edition by Peter Laurie, Ben Laurie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.1. Making Better Indexes in Apache

There is a wide range of possibilities; some are demonstrated at ... /site.fancyindex :

User webuser
Group webgroup
ServerName www.butterthlies.com
DocumentRoot /usr/www/site.fancyindex/htdocs

<Directory /usr/www/site.fancyindex/htdocs>
FancyIndexing on
AddDescription "One of our wonderful catalogs" catalog_summer.html 
    catalog autumn.html
IndexIgnore *.jpg
IndexIgnore  ..
IndexIgnore  icons HEADER README
AddIconByType (CAT,icons/bomb.gif) text/*
DefaultIcon icons/burst.gif
#AddIcon (DIR,icons/burst.gif) ^^DIRECTORY^^
HeaderName HEADER
ReadMeName README
</Directory>

When you type go on the server and access http://www.butterthlies.com/ on the browser, you should see a rather fancy display:

Welcome to BUTTERTHLIES INC  Name Last Modified Size Description 
--------------------------------------------------------------------
    <bomb> catalog_autumn.html 23-Jul-1998 09:11 1k One of our wonderful catalogs 
    <bomb> catalog_summer.html 25-Jul-1998 10:31 1k One of our wonderful catalogs
    <burst> index.html.ok      23-Jul-1998 09:11 1k
-------------------------------------------------------------------- 
Butterthlies Inc, Hopeful City, Nevada 99999

(This output is from Apache 1.3; the year is displayed in four-digit format to cope with the Year 2000 problem.) How does all this work? As you can see from the httpd.conf file, this smart formatting is displayed directory by directory. The key directive is IndexOptions.

7.1.1. IndexOptions

IndexOptions option  option

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required