更改DOCUMENT_ROOT以引用外部URL映像文件路径

This may at first sound easy, but I can't seem to figure it out (maybe it is easy).

I have a big CMS website and I want to create many small sites that each pull some content from the big site.

So for example right now I'm making a website that is going to display a listing of the most recently updated user profiles.

I have created the new site, uploaded the important files and the new website is linked to the big site's database. So when I pull up the site it looks fine, except the images are not appearing.

The reason as far as I can tell is because I have not uploaded the image directory to the new site. I did this because I want the images to be pulled from the main site. That way when a new user registers and uploads a profile image I don't have to copy it to all of the smaller sites.

Now as far as I can tell the problem lies in the /lib/settings.php file on the new site. It references the $siteurl and uses document_root. So when my new sites tried to find the path it is using the URL of the site and not the URL of the main site.

For example all of the images are stored on the main site in a directory called /userimages/

On my new site I need the images to references that: http://theMAINsite.com/images/userimages/file.jpg

But instead it references: http://myNEWsite.com/images/userimages/file.jpg (which of course is not found).

Here are my settings.php variables.

$site_path  = $_SERVER["DOCUMENT_ROOT"].$sitefolder;
$site_url   = "https://".$_SERVER["HTTP_HOST"].$sitefolder;
$main_site_url  = $site_url;
$secure_url = "https://".$_SERVER["HTTP_HOST"].$sitefolder; //SSL USAGE
$site_images_path = $site_path."images/";
$site_images_url = $site_url."images/";
$user_gallery_path = $site_path."images/userimages/";
$user_gallery_url = $site_url."images/userimages/";

Please forgive me if this is a simple issue. I just can't find how to hange the document root to specify the main site so that all of the image URL path pull files from there.

If you have a better option please let me know. Everything on my new website works, I just can't change the path to the /userimage/ directory. And I can't simply enter an absolute URL path because the public files referece the image URL like:

<img src="{$rs_model[m].vImage_url}

Thank you

You don't have to use DOCUMENT_ROOT or HTTP_HOST, do you? Why not do this:

$old_site_url = "http://theMAINsite.com/";
$site_images_url = $old_site_url . "images/";