Adonis K. Kakoulidis
Adonis K. Kakoulidis

Reputation: 5132

Load a custom php file for all directories without an index file

Currently, I use a PHP script to list the contents of a directory that does not have an index file, but I don't want to have to copy it to every directory without an index.

Can Apache do it automatically?

Edit: after searching more i found a way which is to put Option -Indexes and then use that php file as a custom 403 page. source: https://stackoverflow.com/a/10988954/649239

Upvotes: 0

Views: 139

Answers (2)

Adonis K. Kakoulidis
Adonis K. Kakoulidis

Reputation: 5132

after searching more i found a way which is to put Option -Indexes and then use that php file as a custom 403 page.

Upvotes: 0

Jared Drake
Jared Drake

Reputation: 1002

You really to need a strong reason to do this, but assuming you have one...
Just have one php file that accepts the directory as a parameter and use it to print it out.
You could also make it recursive to show all sub directories :) now you've got me excited.

Upvotes: 1

Related Questions