Well, they are puzzles for me, anyway!
On a linux/Apache shared host, a working web site has this directory
structure (for clarity, each directory name ends with "D"):
webD -- the FTP root
......htdocsD -- the DOCUMENT_ROOT
...........index.html
...........topicsD
................topic1.html
......imagesD
...........picture.jpg
If you put http://www.thesite.com/ in a browser address bar you see the
contents of index.html.
index.html contains this (I omit tag angle brackets to avoid confusing some
newsreaders):
img src="imagesD/picture.jpg" ...
As I understand it, this is a relative URI, and the server would look for
imagesD in the same directory that contains index.html. But imagesD is not
in that directory; it's in the parent directory, i.e., imagesD is a sibling
of the directory that contains index.html. How is this working?
topic1.html contains this:
img src="../imagesD/picture.jpg" ...
Again, this seems to me to target the jpg one level below where it really
resides, i.e., up to the parent of topicsD, i.e., htdocsD. But the jpg is
not in htdocsD, it's in htdocs's sibling directory, imagesD.
It's as if the resolution of the relative URIs allowed searching not only
the ending directory, but also its siblings.
On a related but not relative note, here is a form element that is included
(via PHP) on many pages of the site:
input type="image" name="Submit"
src="http://www.thesite.com/images/picture.jpg" ...
Thus there seem to be two document roots, webD (for fetching picture.jpg via
the abolute URI), and htdocsD (for fetching index.html via the URI mentioned
first above).
--
For mail, please use my surname where indicated:
st***@surname.reno.nv.us (Steve Brecher)