homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

image path

Msg#: 4558913 posted 4:11 pm on Mar 27, 2013 (gmt 0)

I'm not even sure if this is the right forum to ask my question in, but here goes.

I've been working with a client for a while and they want to open up a new business with the same info, only geared towards another branch of their business.

The way the host works is to have a separate directory inside the main one, that gets "pointed" to by another domain. Not the best way of going about it, but that's neither here nor there. Because of this, all images are required to have the path through the main domain and directory. I need a way to change the path ONLY for this directory either by php, css or htaccess.

What are the options and best way/s of going about it?
Thanks all!



WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Msg#: 4558913 posted 8:41 pm on Mar 27, 2013 (gmt 0)

Could you explain that over again in English? It would be pretty exasperating to give a long detailed answer and then it turns out you're describing a different situation entirely.

What I think you're talking about is an "add-on domain" setup that's physically structured like this:

/main directory/ (DNS for primary domain points here)
  /subdirectory/ in URL as www.example.com/subdirectory
  /othersub/ in URL as www.example.com/et cetera
  /images/ (yet another subdirectory)
  /example.net (still another subdirectory, where DNS points one level deeper than "primary" domain)

...and then your example.net, which is physically located in a subdirectory, needs to use images that live in a directory which is parallel to rather than inside its base directory


Whenever I hear about "add-on domains" my first impulse is to say Change Hosts. I mean, either you allow multiple domains or you don't. All domains should be parallel. But possibly your setup is something entirely different.

I hope so, because I'm inclined to think you are looking at proxies.

Is there some reason the addon domain can't have its own /images/ directory within its overall domain directory? Is it sharing huge amounts of content with the first domain?


WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Msg#: 4558913 posted 8:46 pm on Mar 27, 2013 (gmt 0)

Browsers access images by requesting a URL. URLs are a reference system used on the web.

Your server configuration maps a request to an internal filesystem location (a file within a folder).

Explain the mapping that you have now, and the mapping you want to add. These descriptions should inlude URLs (things beginning with a protocol and hostname - as used on the web) and internal locations within the server filesystem (a file within a folder, without any protocol or hostname - URLs have no meaning inside a server).


Msg#: 4558913 posted 3:12 pm on Mar 28, 2013 (gmt 0)

The quick answer is yes. The domains should be parallel, but they are not. The host was not my choice, so I'm a little stuck. I have an inelegant solution, but I'm looking for a more elegant solution.
I have a variable in php that has the pathway and I echo it out on every line containing an image.

The bigger issue is that there are some js calls that I'm not sure I can track down.

Current system:
Account: domain- all images are local to the root dir.
Subfolder: new domain image call must go through the root to show up.

<img src="localimage.png" > - works on the main account domain

<img src="accountdomain.com/subfolder/localimage.png" >

<?php $path="accountdomain.com/subfolder/"; ?>
<img src="<?php echo $path; ?>localimage.png">

Am I making sense? What options do I have for the elegant solution without messing up the original pathway?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved