IIS 5 & IIS 6
Classic ASP includes from outside of Root
Last post Mar 01, 2008 06:53 PM by steve schofield
Feb 29, 2008 04:40 PM|thatsgame1|LINK
I'm using IIS 6 and classic ASP. I want to create a virtual directory on my website from a file that is outside of the "default website" but I want to include my "top" and "bottom" (menu system) from within the "default website".
Default website is sitting at: "e:/website - NAME" (shared as "website - NAME" as well)
Ffolder for virtual directory is sitting at: "e:/personnel"
<!-- #include file="e:/website - NAME/includes/top.asp" -->
<!-- #include virtual="e:/websitefoldername/includes/top.asp" -->
<!-- #include file="e:/websitesharename/includes/top.asp" -->
<!-- #include virtual="e:/websitesharename/includes/top.asp" -->
<!-- #include file="websitesharename/includes/top.asp" -->
<!-- #include virtual="websitesharename/includes/top.asp" -->
<!-- #include file="website - NAME/includes/top.asp" -->
<!-- #include virtual="website - NAME/includes/top.asp" -->
Not sure how that works exactly but your help would be most appreciated.
Mar 01, 2008 12:05 PM|steve schofield|LINK
You would use <!--#include virtual=/websitesharename/includes/top.asp-->. There is no concept drive letters when dealing with IIS and files. You configure IIS to point to your files. If the permissions is setup correctly, it should work seemlessly.
Windows Server MVP - IIS
Log archival solution
Install, Configure, Forget
Mar 01, 2008 05:35 PM|thatsgame1|LINK
The file I want to include isn't in a virtual directory it's part of my default website. I am working in a folder outside of the default website.
I'm getting this message:
"Active Server Pages
error 'ASP 0126'
Include file not found
/personneltest/Index.asp, line 2
The include file '/Web Site - FSUS/includes/top.asp' was not found. "
Mar 01, 2008 06:53 PM|steve schofield|LINK
Understood. Make a virtual directory 'inside' your Default Web Site that points to the files 'outside' your working folder. In your code reference the virtual directory that points to the folder / files outside your normal structure. For example
Your default website is a local folder called c:\websites\example.com. Under example.com, all your folders and files. However, the files you want on a file server called FileServerA in a folder called D:\MyWebsiteIncludes. The UNC path is \\FileServerA\D$\MyWebSiteIncludes
or if you create a share on the folder, \\FileServerA\MyWebsiteIncludes On the web server, create a virtual directory that maps to either share path. You'll need to make sure the proper credentials are configured
to access the files on the remote server.