includes across sub domains

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a site
I have 3 subdomains, and is password protected.
All pages end with .php (ie index.php)
I use the following code:


I find that I will require some of the same includes in more than one
Can I do the following?

1) Create a subdomain called with 3 folders - images,
includes and stylesheets
and use




<link rel="stylesheet" type="text/css"
href="" />
 Instead of
<link rel="stylesheet" type="text/css" href="stylesheetraw.css" />


In my style sheet use

#toparea {background-image: url(;
instead of
#toparea {background-image: url(images/gs1.gif); etc


Does the fact that one of my subdomains is password protected complicate

Thank you

Re: includes across sub domains

the include() set of functions require a local-filesystem path. To get
around the same problem as you I have a config file that holds the full
path to my public_html folder (parent of subdomains as they are just
folders there too.) and include this path and then the relative path to
the subdomain's script.

For example...

/home/domains/ .. is my fullpath right ? you can
find yours out by looking on your phpinfo.php page it should be on
there somewhere towards the bottom.

so I store this path in a variable and can call it like so...

$fullPath . "subdomain1/config/another.php"

which will work from any of your subdomains because at the end of the
day they're all on the same filesystem.

Hope this helps,
-Dan Morris

Site Timeline