Jump to content

PHP Includes and Subdomains, how do they work


OInter

Recommended Posts

How do I use includes in my pages residing in the subdomain of my main site?
like this http://subdomain.mysite.com

the includes work fine on the main domain, but I cannot figure out how to get includes to work for the subdomain pages (i use plesk for my host)


am I missing something in my understanding of what works with subdomains?
Hi OInter,

Usually a subdomain is just a folder beneath the root directory,
for example http://subdomain.mysite.com would be something like
/home/mysite/subdomain/ where the root directory is /home/mysite/

To find out what your root directory is you can use $_SERVER['DOCUMENT_ROOT'].

Or you could use include($_SERVER['DOCUMENT_ROOT']."/subdomain/myfile.php");

Hope this helps

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.