In a previous post, you learned how to troubleshoot 401 – Unauthorized: Access is denied due to invalid credentials. In this post, we will cover how to troubleshoot HTTP Error 403.14 – Forbidden in Internet Information Services (IIS). Show Contents Surender Kumar has more than twelve years of experience in server and network administration. His fields of interest are Windows servers, Active directory, PowerShell, web servers, networking, Linux, virtualization, and Kubernetes. He loves writing for his blog. Latest posts by Surender Kumar (see all)
HTTP Error 403.14 – ForbiddenHTTP 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. If the detailed errors are not enabled, you will see a custom error page with a generic message: 403 –Forbidden: Access is denied. 403 Forbidden Access is denied Cause of errorAs indicated by the detailed error page, there are three likely causes of this error:
What a website looks like in a browser when directory browsing is enabled As you can see in the screenshot, directory browsing enables visitors to view files and browse through the directories. The chances are pretty slim that you want your website to look like this.
Viewing the default document for a website in the IIS Manager To add a custom default document (e.g., awesomehome.html), click Add and then type the name of the default document. You could even change the order of documents by selecting one and then clicking the Move Up or Move Down options in the Actions pane on the right.
Resolving the errorWe covered the possible causes of this error in the previous section. Now, depending on your scenario, you could try the following steps to fix this error: Directory browsing is not enabledIf you know that your website should list the contents of the root directory so that visitors can browse the files and folders, you need to enable the Directory Browsing option, using either the IIS Manager or the web.config file. Enable directory browsing using the IIS ManagerOpen the IIS Manager, select your website, and then double-click the Directory Browsing option under IIS in Feature view. Viewing the directory browsing feature in the IIS Manager Now click Enable in the Actions pane on the right. Enabling directory browsing using IIS manager Enable directory browsing using the web.config fileIf you're using a shared hosting server, you could enable directory browsing using the web.config file itself: Open the web.config file and paste the following code between the <system.webServer> and </system.webServer> tags: <directoryBrowse enabled="true" /> Enable directory browsing using the web.config file Default document is not configuredIf your website uses a traditional framework and you see a file with a name such as default.aspx, index.html, or index.php in the website's root directory, make sure the same filename is also available in the list of default documents. You could even ask the developer about the name of the default document for your website. For instance, I know that my website is supposed to use home.html as the default document. Therefore, I will add it either using the IIS Manager or the web.config file. See the following screenshots for reference: Adding a default document for the website using the IIS Manager Adding a default document to a website using the web.config file ASP.NET is not installed on the serverIf neither of the above solutions works, it is likely that your website is using MVC or a similar technology that requires the ASP.NET development feature on the server, and it is not currently installed. This error is common when you try to host an MVC website on a web server for the first time. To install ASP.NET, use the following PowerShell command: Install-WindowsFeature Web-Asp-Net45 -IncludeAllSubFeature This command installs ASP.NET 4.5 or higher on the web server, and your MVC website will start working. If your website is supposed to use a legacy version of ASP.NET (e.g., 3.5 or below), use the following command instead: Install-WindowsFeature Web-Asp-Net -IncludeAllSubFeature Installing ASP.NET on a web server using PowerShell Common 403 substatus codesThe following table covers some common HTTP 403 substatus codes, along with their possible causes and troubleshooting advice: Subscribe to 4sysops newsletter!Status CodePossible CauseTroubleshooting Advice403.1Execute access is forbiddenThis error indicates that the appropriate level of the execute permission is not granted. To resolve this error, make sure the application pool identity has the execute permission.403.2Read access is forbiddenThis error indicates that the appropriate level of the read permission is not granted. To resolve this error, make sure the application pool identity has the read permission.403.3Write access is forbiddenThis error indicates that the appropriate level of the write permission is not granted. To resolve this error, make sure the application pool identity has the write permission.403.4An SSL connection is requiredThis error indicates that the request was made over a nonsecure HTTP channel but the web application is configured to require an SSL connection.403.13The client certificate has been revokedThis error indicates that the client browser tried to use a certificate that was revoked by issuing certificate authority.403.14The directory listing is deniedWe covered how to fix this error above. ConclusionThe key to troubleshooting any IIS-related error is to enable the detailed errors. When the detailed errors aren't helpful in revealing the actual HTTP status and substatus codes, you could use Failed Request Tracing to understand what's going on with the HTTP request. I hope you find this post helpful. |