Add to Favorites
Hosting Discussion
 

forgot password?


SPONSORED LINKS

Reply


Old
  Post #1 (permalink)   11-04-2007, 09:19 PM
HD Wizard
 
Exon's Avatar
 
Join Date: Jul 2003
Location: IA
Posts: 1,020

Status: Exon is offline
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?
__________________
John "Exon" Pinkerton
jpinkerton@exonnet.net
http://www.ExonNet.net
 
 
 


Old
  Post #2 (permalink)   11-04-2007, 09:24 PM
HD Wizard
 
Exon's Avatar
 
Join Date: Jul 2003
Location: IA
Posts: 1,020

Status: Exon is offline
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.
__________________
John "Exon" Pinkerton
jpinkerton@exonnet.net
http://www.ExonNet.net
 
 
 


Old
  Post #3 (permalink)   11-05-2007, 04:10 AM
HD Moderator
 
ldcdc's Avatar
 
Join Date: May 2004
Location: Ploiesti
Posts: 2,443

Status: ldcdc is offline
../ 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.
 
 
 


Old
  Post #4 (permalink)   11-05-2007, 11:33 AM
Data Center Specialist
 
Join Date: Aug 2005
Location: United Kingdom
Posts: 840

Status: Marks is offline
try:

<? php
require("../content/header.php");
?>
__________________
SHE Is Getting Ready
 
 
 


Old
  Post #5 (permalink)   11-05-2007, 01:24 PM
HD Wizard
 
Exon's Avatar
 
Join Date: Jul 2003
Location: IA
Posts: 1,020

Status: Exon is offline
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
Quote:
Parse error: syntax error, unexpected T_REQUIRE in /home/MAIN/public_html/ADDON/index.php on line 38
__________________
John "Exon" Pinkerton
jpinkerton@exonnet.net
http://www.ExonNet.net
 
 
 


Old
  Post #6 (permalink)   11-06-2007, 10:19 AM
HD Wizard
 
Exon's Avatar
 
Join Date: Jul 2003
Location: IA
Posts: 1,020

Status: Exon is offline
Found that if I go to:
http://www.MAINSITE.com/ADDONDOMAIN it works fine.

It is something with accessing it from the www.ADDONDOMAIN.com that breaks it. Thoughts?
__________________
John "Exon" Pinkerton
jpinkerton@exonnet.net
http://www.ExonNet.net
 
 
 


Old
  Post #7 (permalink)   11-06-2007, 12:42 PM
HD Moderator
 
ldcdc's Avatar
 
Join Date: May 2004
Location: Ploiesti
Posts: 2,443

Status: ldcdc is offline
Maybe you simply can't ../ simply via http due to how the addon is normally setup. Did you try asking over at cpanel's forums?
 
 
 


Old
  Post #8 (permalink)   11-19-2007, 10:02 PM
HD Newbie
 
Join Date: Nov 2007
Posts: 27

Status: dbihosting is offline
Would symbolic linked directories solve your problem?
__________________
DBI Hosting - Shared - Dedicated - VPS - Managed
 
 
 
Reply

Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On