There are two ways to reference a file in applications:
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:
There are two solutions to fix this issue:
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.