The docs have a great example - dynamically generate the content if the
index.html file is not present or has 0 btes, be sure to set the mime
type to x-application-php or whatever it is in the php handler for your
server.
On-the-fly Content-Regeneration:
http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide_advanced.html
where you pass the ${SCRIPT_URL} through in the query string to the cgi
(or php script)
As for the icons etc.. they are served by default from a site wide
alias
/icons/
so youre safe there,
and if you need to bind any more icons to strange files types, use an
..htaccess file in root, or for perfermance put them into the server
config:
here is an example from a custom index .htaccess I use:
Options +Indexes -Includes
HeaderName HEADER.html
ReadmeName README.html
AddIcon (cdISO,/apache_icons/cd_rom.png) memtest.iso
AddIcon (MSI,/apache_icons/msi.png) .msi
AddIcon (Archive,/apache_icons/compressed.png) .7z .tar .bz .bz2
AddIcon (Extension,/apache_icons/firefox.png) .xpi
AddIcon (AntiVirus,/apache_icons/bomb.png) .ref
AddIcon (HOSTS,/apache_icons/world1.png) HOSTS
IndexOptions +FancyIndexing -IconsAreLinks +FoldersFirst +NameWidth=*
+IgnoreCase +SuppressDescription +SuppressHTMLPreamble
IndexIgnore *.js *.php *.jpg *.gif *.pdf .. HEADER* README*
be careful to control who has access to the index.html, see you /could/
just create a custom 403 page, then you can use env vars like normal to
capture what was requested, you could then control whether the 403 page
resulted in an 403 header and subsequent error page, or whether it just
sent the index for that directory and status 200 based on a small php
whitelist array, I would use apache, however the php whitelist custom
403 thingy works too, provided you override the headers.
>> Stay informed about: Custom auto indexing