Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am using webspace hosted on IIS 7.5 (according to phpinfo() ). Currently, I am enabling directory listings for a directory and all its subdirectories by placing a web.config like

<location path=".">
    <system.webServer>
      <directoryBrowse enabled="false" />
    </system.webServer>
</location>

in it. Is there a way to disable the directory listing in the directory itself but enable it for all its subdirectories without placing a web.config in each subdirectory or listing all subdirectories here?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

If this works in a similar way to Apache, then you could simply create an index.php file (or whatever your directory index file is) in the directory that you don't want to see a directory listing.

share|improve this answer
    
Of course, that would work, thank you! –  Jens May 11 '12 at 18:59
add comment

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.