httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <>
Subject Re: [users@httpd] fancy indexing
Date Thu, 03 Jul 2003 10:57:34 GMT
Ken Gillett wrote:
> Shame. Unfortunately writing my own module is not practical at present.
> But I would be able to incorporate the path at the top as a breadcrumb
> trail as I want, but cannot do with the standard module. Maybe in the
> future.

You wouldn't need to write a module. You could, using PHP, make an
'autoindex.php' like this:

$dir = opendir('.');
while(($file = readdir($dir)) !== false) {
    if(preg_match('/^\./', $file)) continue;  // no hidden files
    $file = preg_replace('/\.\w+$/', '', $file);  // remove extension
    echo "$file<br>";

Not very fancy looking, but you get the idea ;)

Then add 'autoindex.php' to the DirectoryIndex directive and drop it in each
directory you want it, or you could use some more advanced matching

> > I cannot see what mod_rewrite would have to do with AutoIndex.
> Neither can I, but I thought I'd seen a post from someone wanting to
> hide extensions using mod_rewrite. I couldn't really grasp what he was
> after and I'm not a mod_rewrite expert (or user at all in fact) so
> thought I'd just ask.

That was most likely on the other end, or so to speak. He wanted Apache to
serve files without explicit extensions.

Robert Andersson

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message