Blog Post

IIS Support Blog
1 MIN READ

Disallowed Parent Path

Nedim's avatar
Nedim
Former Employee
Nov 25, 2019

There are two ways to reference a file in applications:

  • An absolute path (Ex: /folder/file)
  • relative path (Ex: ../folder/file)

If you use a relative path in your ASP code, you may come across to “Disallowed Parent Path” error if your IIS server is not configured properly.

 

Examples of include statement using a relative path:

 

<!--#include file="../file.asp"-->
<%   Response.Write Server.MapPath("../example.asp")%>

 

 

This error message shows up as “500 – Internal Server Error”. To find out the actual reason, use Failed Request. Here is what I found in my case:

 

Solution

There are two solutions to fix this issue:

  1. Use absolute paths instead of relative paths
  2. Allow the usage of relative paths (IIS doesn’t allow it by default)

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

 

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

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

Refer to this Microsoft article for more information on ASP parent paths. It was written long time ago for IIS 6 but it still applies to newer IIS versions.

Published Nov 25, 2019
Version 1.0
No CommentsBe the first to comment