Last active
August 19, 2019 06:56
-
-
Save joe-oli/a3c9c69ddb661f7e7c98eb4f062ac7db to your computer and use it in GitHub Desktop.
disable directory browsing a folder on IIS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set the Web.config for the site which you want to disable dir-browsing; any child folders within the site are also non-browsable. | |
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<system.webServer> | |
<directoryBrowse enable="false"/> | |
</system.webServer> | |
</configuration> | |
//to scope it to a specific folder within the Site or App, use location tag. | |
<configuration> | |
<location path="your/path/here"> | |
<system.webServer> | |
<directoryBrowse enabled="true" /> | |
</system.webServer> | |
</location> | |
</configuration> | |
//NB: applies only to IIS 7 +; For IIS 6, use IIS Manager to configure this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment