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"
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.
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.
thatsgame1
8 Posts
Classic ASP includes from outside of Root
Feb 29, 2008 04:40 PM|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"
I've tried:
<!-- #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.
steve schofi...
5682 Posts
MVP
Moderator
Re: Classic ASP includes from outside of Root
Mar 01, 2008 12:05 PM|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.
http://www.w3schools.com/asp/asp_incfiles.asp
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
thatsgame1
8 Posts
Re: Classic ASP includes from outside of Root
Mar 01, 2008 05:35 PM|LINK
Hi Steve,
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. "
</div>steve schofi...
5682 Posts
MVP
Moderator
Re: Classic ASP includes from outside of Root
Mar 01, 2008 06:53 PM|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.
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget