Issue With Code

Exon

New member
I've got an issue with some code, and not sure how to figure it out.

What I have is a functioning base site in the root directory. It has all the functioning code and graphics.

What I want is to be able to have Addon Domains that point to a folder and pull the graphics and code from the main site.

So I've got the index, content, and images all in public_html for the main site.

Then I do the addon domain, and I want it to pull the images and content from the root directory.

www.mainsite.com holds all the files.
www.lookalike.com pulls all files from the root directory - mainsite.com

It works just fine for the content using includes:
Code:
<?php include "../content/header.php" ?>
- this pulls all the header files, all content pages load without issue. However, when the header.php file, attempts to load the images
Code:
<img src="/images/pmcclellan.gif" border="0">
They do not load.

I've tried ../, ./, ../../, /../../, and a million other variations, but it just does not work no matter what I try, but all pages and content files load just fine, and they are pulling from the content folder just one directory above them.

Is this clear as mud? Did I make any sense?
 
Okay, let me try and make this a little more clear.

I've got the main directory, and then within the main directory I've got a folder. In that folder is the index.php file which pulls all content and images from a folder a directory above it.

If I go to the site via: www.mainsite.com/ADDON everything works fine. But if I go to the site via: www.ADDON.com images don't load, but content does.
 
../ should actually work.. I think.

While just workarounds, why not copy the images locally in the addon domain folder? Or use the full URL using mainsite.com?

That is unless you're more after the knowledge than the results. :)
 
Dan,
The problem with copying the images folder to each addon domain is that anytime an image changed on the main site, the image would have to be uploaded for each addon domain. Currently looking at 50, and growing.

Marks,
If I do that I get
Parse error: syntax error, unexpected T_REQUIRE in /home/MAIN/public_html/ADDON/index.php on line 38
 
Maybe you simply can't ../ simply via http due to how the addon is normally setup. :confused: Did you try asking over at cpanel's forums?
 
Back
Top