Reputation: 11
What is the value of site name in the following code when we get a error like this as shown
appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
Most likely causes: A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
Things you can try: If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists. Enable directory browsing. Go to the IIS Express install directory. Run appcmd set config /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the server level. Run appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the site level. Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.
Upvotes: 0
Views: 4963
Reputation: 12749
You get this error because the website does not have the 'Directory Browsing' feature enabled.
Firstly you need to check that you install directory browsing feature or not.Then you could enable directory browsing by following ways:
Using IIS manager console window:
1)Open Internet Information Services (IIS) Manager.
2)From the Connection Pane select Site name for which you want to enable directory browsing.
3)From Feature View Select Directory Browsing. 4)In the Actions pane, click Enable.
You could also set this by using the command prompt:
1)Open a command prompt as administrator.
2)Run below command: appcmd set config "urlsample" /section:system.webServer/directoryBrowse /enabled:true
appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true
In ["SITE_NAME"] you need to specify the name of your site which you set in IIS.
You could also set in web.config file under the system.webserver section:
<directoryBrowse enabled="true" />
You could also refer below article for more detail:
Regards, Jalpa.
Upvotes: 0
Reputation: 467
If you are able to use AppCmd, then use AppCmd list sites
to dump out all the configured sites. You'll need to select the correct one (if there are more than one) based on the binding information.
Upvotes: 0