Welcome to WebmasterWorld Guest from 54.198.114.138

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

image path

     
4:11 pm on Mar 27, 2013 (gmt 0)

Junior Member

joined:Oct 19, 2011
posts: 166
votes: 1


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!
8:41 pm on Mar 27, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13204
votes: 346


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
  /thirdsub/
  /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?
8:46 pm on Mar 27, 2013 (gmt 0)

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 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).
3:12 pm on Mar 28, 2013 (gmt 0)

Junior Member

joined:Oct 19, 2011
posts: 166
votes: 1


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?
Thanks!