Web Hosting Talk







View Full Version : How to do local linking


Archbob
03-14-2003, 09:39 PM
Hey, I'm on a FreeBsd with apache webserver, however, I can't get the local links to work right.

I have a diretory called images in my main domain folder. I just want all images calls from every page to go to that folder.

I tried img src= " ../images/image.gif " however, it does not always work, how do I do this?

deadserious
03-14-2003, 09:45 PM
Maybe try removing the two dots so it's like:

<img src="/images/img.gif">

or like this:

<img src="images/img.gif">

Archbob
03-14-2003, 10:18 PM
I figured it out its ../../images/image.gif

bear
03-14-2003, 10:44 PM
Originally posted by deadserious
Maybe try removing the two dots so it's like:

<img src="/images/img.gif">

or like this:

<img src="images/img.gif"> The 2 dots represent moving up and out of the folder it's being called from (document relative links). A leading slash means start from the document root (root relative), and nothing in front means that the folder "images" exists in the same directory level as the calling page.
../../ means to go up 2 directory levels and so on...

But you probably knew all this already.

Archbob
03-15-2003, 12:25 AM
No, I just stembled upon my answer.

deadserious
03-15-2003, 01:28 AM
Originally posted by bear
The 2 dots represent moving up and out of the folder it's being called from (document relative links). A leading slash means start from the document root (root relative), and nothing in front means that the folder "images" exists in the same directory level as the calling page.
../../ means to go up 2 directory levels and so on...

But you probably knew all this already.

I know, they said their images directory was inside their "MAIN" domain directory so the way I suggested should have worked if that was the case depending on where the directory resides they were calling them from though:D But you explained it well. :)