Skip to main content

(Solved) Disallowed Parent Path error (ASP 0131 ASP_LOG_ERROR)

There are two ways to reference a file in your code: Using an absolute path (Ex: /folder/file) or using a relative path (Ex: ../folder/file). If you use a relative path in your ASP code but your IIS server is not configured properly, you may come across to “Disallowed Parent Path” error (ASP 0131 ASP_LOG_ERROR).

An example include statement that uses a relative path:

<!--#include file="../file.asp"-->

Another example of the relative path usage:

The Most Functional and Compact Toiletry Bag
<%
   Response.Write Server.MapPath("../example.asp")
%>

This error message shows up as “500 – Internal Server Error” which is a generic error message IIS displays for code and configuration related issues. In order to dig deeper in the 500 error, enable Failed Request Tracing in IIS and collect logs.

Here is a sample Failed Request Tracing log that shows “Disallowed Parent Path” error:

"Disallowed Parent Path" error (ASP 0131 ASP_LOG_ERROR)

Solution for Disallowed Parent Path error (ASP 0131 ASP_LOG_ERROR)

There are two alternative solutions to fix this issue:

  1. Change the application code to use absolute paths instead of relative paths
  2. Allow the usage of relative paths by changing configuration of IIS (By default, IIS doesn’t allow it)

In most cases, the second option (Changing the IIS configuration)nis preferred because it provides a faster solution.

Allow Relative Paths in IIS

Follow the steps below to allow relative paths so that IIS won’t throw “Disallowed Parent Path” error anymore:

  1. Go to IIS Manager
  2. Click on the website name
  3. Double click ASP icon
  4. Set “Enable Parent Paths” to “True
Enable Classic ASP Parent Paths

For more information on ASP parent paths, please refer to this Microsoft article. This article was written long time ago for IIS 6 and earlier versions but it still applies to newer IIS versions.

After changing the IIS configuration, you may come across a configuration file related error if the change hasn’t been done properly. Check this post out for step-by-step solution instructions: Configuration file is not well-formed XML (IIS Shared Configuration)

The Most Functional and Compact Toiletry Bag

Leave a Reply

Your email address will not be published. Required fields are marked *