I have a website which needs to use a default document for the application root, but must not for subdirectories. I'm using the "directory browsing" feature, but I only want it to work for subdirectories.
here's a snip of my web.config:
<system.webServer> <defaultDocument enabled="true"> <files> <clear /> <add value="1f200f74-07e5-4681-a275-e9cbc9f1b794.txt" /> </files> </defaultDocument> <directoryBrowse enabled="true" />
I tried applying inheritInChildApplications to the defaultDocument element, but that does not work, actually it makes the application fail. So I want defaultDocument to only apply to the root, and I want to apply directoryBrowse to all subdirectories.
I realize I could have web.config files in each immediate subdirectory, and apply a clear to defaultDocument, but I can't put web.config files in those directories (the nature of this app does not allow that). (Also, allowSubDirConfig doesn't work here, that would just prevent processing of web.config files in subdirectories.)
Is there configuration in web.config which will apply a setting to that node only ?