You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ken Gillett <ke...@ukgb.net> on 2003/07/03 09:34:41 UTC

[users@httpd] fancy indexing

Is it possible to hide the extension of files when they are listed for 
a directory, i.e. when Apache is just supplying a list of the filenames 
in the directory?

I can't find a simple switch for this, would mod_rewrite do it? Not 
being a re-writing expert, any suggestions how to do it?



Ken  G i l l e t t

_/_/_/_/_/_/_/_/_/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] fancy indexing

Posted by Ken Gillett <ke...@ukgb.net>.
Had previously thought about doing exactly what you suggest here, but 
there's over 1000 directories to be indexed in this way so a file in 
each one would be rather wasteful.

Actually I've just thought of the ultimate quick fix to this - rename 
the files without extensions:-)


On Thursday, July 3, 2003, at 11:57  am, Robert Andersson wrote:

> 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>";
> }
> closedir($dir);
>
> 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
> technique.



Ken  G i l l e t t

_/_/_/_/_/_/_/_/_/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] fancy indexing

Posted by Robert Andersson <ro...@profundis.nu>.
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>";
}
closedir($dir);

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
technique.


> > 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.

Regards,
Robert Andersson




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Online users

Posted by Patrick Donker <pa...@reporters.net>.
Are there tools, or is there a way to monitor what users are online on 
my website and what they are doing while online?

TIA
Patrick


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] fancy indexing

Posted by Ken Gillett <ke...@ukgb.net>.
Thanks.

On Thursday, July 3, 2003, at 08:49  am, Robert Andersson wrote:

> Ken Gillett wrote:
>> Is it possible to hide the extension of files when they are listed for
>> a directory, i.e. when Apache is just supplying a list of the 
>> filenames
>> in the directory?
>
> No, I don't think so. Sorry. However, it is not very hard to write a 
> Perl or
> PHP script doing the same thing as AutoIndex does; it's a really simple
> feature, and isn't meant to be all that powerful as it's trivial to do 
> it
> yourself if you need it customized.

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.

>> I can't find a simple switch for this, would mod_rewrite do it? Not
>> being a re-writing expert, any suggestions how to do it?
>
> 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.



Ken  G i l l e t t

_/_/_/_/_/_/_/_/_/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] fancy indexing

Posted by Robert Andersson <ro...@profundis.nu>.
Ken Gillett wrote:
> Is it possible to hide the extension of files when they are listed for
> a directory, i.e. when Apache is just supplying a list of the filenames
> in the directory?

No, I don't think so. Sorry. However, it is not very hard to write a Perl or
PHP script doing the same thing as AutoIndex does; it's a really simple
feature, and isn't meant to be all that powerful as it's trivial to do it
yourself if you need it customized.

> I can't find a simple switch for this, would mod_rewrite do it? Not
> being a re-writing expert, any suggestions how to do it?

I cannot see what mod_rewrite would have to do with AutoIndex.

Regardsm
Robert Andersson




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org