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).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.