Score:0

Allow browse directory on sub directory only

es flag

I have an ASP.NET Core website which contains the binaries and resources needed to run the website. The site generates log output in a "Log" directory, located inside the web site's root directory.

I would like to be able to browse the contents of this "Log" directory, without allowing browsing of any other directories belonging to the website.

Is there any way to achieve this in IIS or will I need to convert the "Log" directory to a separate application in order to allow directory browsing in that directory?

Score:1
ye flag

Restricting Directory Browsing in IIS

You can restrict directory browsing in IIS by setting the appropriate directory browsing options in the IIS Manager. Here's how you can do it:

  1. Open IIS Manager
  2. Select your ASP.NET Core website
  3. Click on "Features View"
  4. Double click on "Directory Browsing" under the "IIS" section
  5. On the "Directory Browsing" page, select "Log" directory
  6. In the "Actions" pane, click on "Enable" under the "Directory Browsing" option
  7. You can also specify custom options such as the format of the directory listing, etc.

This will allow directory browsing for the "Log" directory and restrict it for other directories.

Alternatively, you can create a separate application in IIS for the "Log" directory and set the directory browsing options for that application.

Mort avatar
es flag
Adding browsing permissions to the Log directory will create a web.config file in that directory, which is then visible when browsing the directory. Is there any way to hide this generated web.config file from the directory when browsing to it?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.