How to Fix “HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents of this directory”
Get link
Facebook
X
Pinterest
Email
Other Apps
This is one of the most common issue that developed faces when they start the New Website published with IIS or IIS Express.
I searched internet a lot to find the exact issue and the solution
that I found is to enable "Directory Listing" for the web site, similar
guidance will be shown on the error page itself, but it is not
recommended for security reasons.
So to fix this issue, the easiest and best way is to add the default
page or document that IIS should look while you click on browse or F5
from Visual Studio.
1. Open IIS (Type InetMgr)
2. Go to the WebSite you are facing the issue
3. Click on Default Document Button, you will find it on the right side tab in IIS.
4. You can see a list of default documents, but your default page
(aspx file) is not mentioned here and that is causing the issue.
5. Add your file here. (For example: Login.aspx)
You can also add the following entry into the web.config:
<system.webServer>
<defaultDocument>
<files>
<add value="Login.aspx" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
</system.webServer>
Now run the website again .. and yes .. that will work now.
So to fix this issue, the easiest and best way is to add the default page or document that IIS should look while you click on browse or F5 from Visual Studio.
1. Open IIS (Type InetMgr)
2. Go to the WebSite you are facing the issue
3. Click on Default Document Button, you will find it on the right side tab in IIS.
4. You can see a list of default documents, but your default page (aspx file) is not mentioned here and that is causing the issue.
5. Add your file here. (For example: Login.aspx)
You can also add the following entry into the web.config:
<system.webServer>
<defaultDocument>
<files>
<add value="Login.aspx" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
</system.webServer>
Now run the website again .. and yes .. that will work now.