1

I need to make my server list directories with a php script I use and would like to just use 1 file for listing the directories, not millions scattered 1 in each directory. Is it possible to use real file paths for the default document field? It can be used when there are no index files in any certain directory to forward to my php script.

2 Answers 2

2

There is no way to do this by the default IIS, without doing some nasty hacks.

One way to do this is to use URL Re-Writing. You need to leave the Default Document as index.html (or whatever), and using re-writing, re-direct any request to index.html (or any URL with a trailing slash, or whatever) to point to your PHP file.

IIS7 has this functionality built in (I've not used it so I don't know where to find it). For IIS6 and below you will need ISAPI ReWrite to achieve this.

Another way is to change your Document Handler for a 404 (or whatever the appropriate response is when no default document is found) to run your PHP script. This will generate a lot of failures in your log file though.

You can find this property in IIS6 by right-clicking on your website and going to Properties. I don't know where to find it in IIS7 but I'm sure it's around.

0

This is probably a stupid answer but if you want to list directories, can't you just turn on directory browsing or something?

1
  • The thought crossed my mind too, but I assumed that it must do some pre-processing or formatting or something Oct 8, 2009 at 20:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .