PDA

View Full Version : Customizing Directory Listing


Jeff
10-25-2000, 04:23 AM
It might be neat if Apache offered an option to specify a template for the standard directory listing like the customized error pages.

Does anyone know of an easy way to "template-ize" the directory listing.[nbsp][nbsp]This would probably be PHP, but I'm wondering if there is a simple index page/script which would provide a template based directory listing (excluding itself, of course) for any directory I put it in, so if I simply wanted to share a directory of temporary/changing photographs, I could drop in the template index.php file and the current directory listing would be created with my site's logo and layout.[nbsp][nbsp]Or maybe there would be an even easier way...

Also, is there an easy way to add a description which shows on Apache's directory listing.[nbsp][nbsp]What is the max description length?

[This message has been edited by Jeff (edited 10-25-00@04:24 am)]

Justin
10-25-2000, 05:18 AM
Technically, your "index.html" (or similar) page is your directory index, just as 404.html (for example) is your 404 page. If a default isn't there, the server comes up with its own default.

You would need to write a script to do this. A simple way might be to create a script within the cgi-bin, and use an index.shtml page to include it in. Perhaps have the cgi script determine the directory based on the referer URL...

The default index can be quite customized, but only within the server configuration (not within .htaccess AFAIK)...

------------------
Justin Nelson
FutureQuest (http://www.FutureQuest.net/index.php) Support