Jump to content

Is it possible to access a subdomain files from another subdomain?


Ivan Ivković

Recommended Posts

If the shared files are on the same server, and are not website files (files accessed through a browser) you should put them in sibling directory.

 

example:

/www/classes

/www/a.domain.com

/www/b.domain.com

 

In apache the directory www shouldn't be accessible via browser, though a.domain.com and b.domain.com should be.

Doing it like this IMO makes accessing the classes folder easy from either domain.

 

they both could look something like this from some file:

 

require_once dirname(__FILE__)."/../classes/SomeClass.php";
//if your server supports __DIR__:
require_once __DIR__."/../classes/SomeClass.php";

 

If your just posting data, it doesn't matter what server. You could post data to Google if you wanted from your domain as long as you have all the right post fields. Google does a lot of processing before accepting your data but if they didn't you could post easily (if that makes sense).

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.