Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP Error 403.14 - Forbidden - The Web server is configured to not list the contents of this directory

Tags:

asp.net

iis

People also ask

What is HTTP Error 403.14 forbidden?

The HTTP Error 403.14 – Forbidden is displayed when you try to access a website hosted on IIS having detailed errors enabled. As you can see in the screenshot, the error page says The Web server is configured to not list the contents of this directory and also indicates the most likely causes of this error.

How do you solve this error the Web server is configured to not list the contents of this directory?

To do it, select Start, select Run, type inetmgr.exe, and then select OK. In IIS Manager, expand server name, expand Web sites, and then select the website that you want to change. In the Features view, double-click Directory Browsing. In the Actions pane, select Enable.


keep this into your web config file then rename the add value="yourwebformname.aspx"

<system.webServer>
    <defaultDocument>
       <files>
          <add value="insertion.aspx" />
       </files>
    </defaultDocument>
    <directoryBrowse enabled="false" />
</system.webServer>

else

<system.webServer>
    <directoryBrowse enabled="true" />
</system.webServer>

This problem occurs because the Web site does not have the Directory Browsing feature enabled, and the default document is not configured. To resolve this problem, use one of the following methods. To resolve this problem, I followed the steps in Method 1 as mentioned in the MS Support page and its the recommended method.

Method 1: Enable the Directory Browsing feature in IIS (Recommended)

  1. Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.

  2. In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.

  3. In the Features view, double-click Directory Browsing.

  4. In the Actions pane, click Enable.

If that does not work for, you might be having different problem than just a Directory listing issue. So follow the below step,

Method 2: Add a default document

To resolve this problem, follow these steps:

  • Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
  • In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
  • In the Features view, double-click Default Document.
  • In the Actions pane, click Enable.
  • In the File Name box, type the name of the default document, and then click OK.

Method 3: Enable the Directory Browsing feature in IIS Express

Note This method is for the web developers who experience the issue when they use IIS Express.

Follow these steps:

  • Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt: C:\Program Files\IIS Express

  • Type the following command, and then press Enter:

    appcmd set config /section:system.webServer/directoryBrowse /enabled:true


Go to cmd and type this:

for x64 O.S: %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir

for x32 O.S: %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir

This will install the right version and IIS will understand the MVC directory browsing


There can be multiple reasons for the issue. One that worked for me on IIS 8.5 was as follow

Steps

  1. Type "turn windows features on or off" in search.
  2. Click on "Add Roles and features" in Server Manager.
  3. In Wizard scroll down to the Web server and select : Web Server -> Application Development. Select all except CGI from the list as shown in the screen shot

enter image description here

  1. Finally hit next and Install.
  2. Restart IIS

Your website may start working.


Set a start page.

When I had this problem, I went into the solution explorer, found the page I wanted to see first (in my case "Home.aspx), right clicked on it and selected "Set As Start Page." This fixed my issue (which sounded really similar to yours). This was in Visual Studio 2012 Professional and I ran it in Firefox.


I just pasted this code snippet inside web.config file and the error was solved.

<system.webServer>
    <directoryBrowse enabled="true" />
</system.webServer>