Protect Website Folders via Web.config

If you would like to configure password protect for some of your website folders you can do it via web.config directly instead disable the anonymous access on IIS. Just make a new web.config in that folder and paste into the following

<configuration>
  <system.webServer>
    <security>
      <authorization>
        <add accessType="Deny" users="?" />
      </authorization>
    </security>
  </system.webServer>
</configuration>

You can configure the specific user from the folder permissions.

Share

- has written 121 posts.


Leave a Reply

You must be logged in to post a comment.