Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know. This sounds complicated =D I made a PHP file browser, as an alternative to the apache one. I needed it for logic purposes, it does extra things for me, &etc. So instead of dropping this file in all of my directories, how could I get it to "show up" in all my directories that don't have an index (would use the apache dirlisting by default)? Thanks for the help!


I wonder if this could be done using Alias and DirectoryIndex? Is it possible to alias to a file?

share|improve this question

Not actually helping but it can be done easily in nginx. Here's how I did it.

share|improve this answer
Hm. Thanks! I just wish I could do this in Apache without an edit to the mod_autoindex sources. – Kyle Feb 12 '10 at 7:56

Could you use URL rewriting to change all urls ending in "/foldername" or "/foldername/" (i.e. not ".html") to /myscript?folder=foldername ?

share|improve this answer

I use something like this for my zend framework projects. It tells index.php to handle every request for files that don't already exist. You can get creative with the regular expressions or add other RewriteConds to be more selective about when it sends the request to the index.php.

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /path/to/index.php [NC,L]

See the Apache Documentation for descriptions of the flags and for the full list of server variables.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.