The main domain includes a virtual file like this:
<!--#include virtual="/includes/functions/index.asp"-->
That in turn includes a whole bunch of function files, something like this:
<!--#include virtual="/includes/function/includedfunctionone.asp"-->
<!--#include virtual="/includes/function/includedfunctiontwo.asp"-->
<!--#include virtual="/includes/function/includedfunctionthree.asp"-->
But when I try to include these from a subdomain, they can't be found. I presume because the server is searching for the /includes/functions/index.asp
within the subdomain itself.
I can access the main include from the subdomain changing it to a relative path:
<!--#include file="../includes/functions/index.asp"-->
However, that breaks when the main file calls the list of nested virtual includes. And I don't want to change all of those to #include file
, because they need to be absolute paths.
What I've Tried 1
I have tried using a full server path like this:
D:\domains\website.com\wwwroot\includes\functions\index.asp
... but that gives me 'ASP 0126' Include file not found
What I've Tried 2
I've also tried including a full url, like this:
http://website.com/includes/functions/index.asp
... but that gives me a fat bold 500 error with no indication of the specific error.
Here's my comment as an answer.
In IIS manager, setup the folder containing your includes as a virtual directory of each website where you need to use it - then you can use
More details here - Scroll down to "The Virtual Keyword"