1

I have a batch of files in

/home/***/construct/

which I have symlinked to the subdomain 'http://sampleaccount.mywebsite.com' so that the '/constuct/' directory appears in that subdomain's specific directory tree.

The files within '/construct/' are master page-layout files that include PHP includes to a '/bodyCopy/' directory within the 'sampleaccount' subdomain. For example:

<?php include("bodyCopy/copy-content.php"); ?>

BUT...

I keep getting an error on my Web page that indicates PHP is searching for the 'copy-content.php' file in the '/bodyCopy/' directory in /home/*/construct/ (which does not exist) instead of in the '/bodyCopy/' directory located within 'http://sampleaccount.mywebsite.com', as in...

http://sampleaccount.mywebsite.com/bodyCopy/copy-content.php

Therefore, how do I make the symlinked master page-layout files search the current directory TO WHICH THEY ARE LINKED search for the '/bodyCopy/' directory in the 'sampleaccount' subdomain instead of it searching the root?

The caveat is that the '/construct/' directory in root will be symlinked to multiple subdomain accounts, each with their own '/bodyCopy/' directories, so I cannot use a hard link in the master page-layout files.

Thanks in advance for any solutions provided. -- Jet

Jet Jagger
  • 11
  • 2

1 Answers1

0
 <?php include("/rootfoldername/bodyCopy/copy-content.php"); ?>

or

 <?php include("../bodyCopy/copy-content.php"); ?>
Brutnus
  • 163
  • 2
  • 9
  • Brutnus, that is what I am doing now, but it is searching for the '/bodyCopy/' directory inside '/home/****/construct/' instead of 'http://sampleaccount.mywebsite.com/'. – Jet Jagger Oct 11 '12 at 20:33
  • Are you trying to include a php page from another site? – Brutnus Oct 11 '12 at 20:58
  • Brutnus, no. The page is on the same domain. The '/construct/' directory is located here: '/home/****/construct/' ... and a master file within it contains a PHP Include to include a content file from the '/bodyCopy/' directory located here: '/home/****/public_html/sampleaccount/bodyCopy/' (whereas 'sampleaccount' is a subdomain. The issue is that the PHP Include is trying to search '/home/****/construct/' for the '/bodyCopy/' directory when it doesn't exist there. The '/construct/' directory (and the files within it) is symlinked to the 'sampleaccount' subdomain. – Jet Jagger Oct 11 '12 at 21:31
  • and this doesn't work either? include("/home/****/public_html/sampleaccount/bodyCopy/copy-content.php"); – Brutnus Oct 12 '12 at 14:35
  • Keep in mind that the /construct/ directory is located in the root and is being symlinked into MULTIPLE subdomains. Not all subdomains will be called 'sampleaccount'. So, YES, your suggestion works IF I was only using the symlink in a single subdomain, but NO, it will not work because there are many subdomains to which the /construct/ directory will be symlinked. – Jet Jagger Oct 12 '12 at 16:29