Knowledgebase: Shared Hosting
Do you support Parent Paths in ASP Scripts?
Posted by Phil (Netcetera) on 07 January 2008 05:02 PM
Parent Paths are a security risk and hence they are been disabled as per Microsoft's recommendation. Instead of using Parent Path, change:

<% #INCLUDE FILE="../includes/myinclude.asp" %>

to

<% #INCLUDE VIRTUAL="/virtual_path/includes/myinclude.asp" %>

Where "virtual_path" is determined by mapping the directory or virtual directory hierarchy from the root of the site. Please also note that Virtual Path requires an absolute path starting from your root web directory.

Please review the following Microsoft KB for more info: http://support.microsoft.com/default.aspx?scid=KB;en-us;q184717

Alternatively, if you wish to store the include files above your web root directory, you can use an absolute path starting from your home directory. For example:

<% #include file="d:\virtualservers\000000\root\includes\myinclude.asp" %>

The bold part is your FTP home directory under /www/.

To find out what your home directory is, you can write a simple ASP script such as this:

<% Response.Write Server.MapPath("/") %>

This will show you the web root directory where your web site files reside. Your Home directory would be the path above the web root directory.

Most modern programmer's editors have global search / replace function that works across all files which will make converting the use of parent paths to either absolute or virtual path easier
(800 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: