Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

Edit

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

share|improve this question

3 Answers 3

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

 
discard

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.