4
Contributors
5
Replies
7
Views
7 Years
Discussion Span
Last Post by Zagga
0

Hi zer0cool,

<img src="/images/picture.jpg" /> is a relative link (it is relative to the location of the doccument that contains it), not an absolute link.

If you copy the directory structure to the developement server, you shouldn't need to change any links if they are all relative. Of course, this would mean placing all of this clients website files on the root of your dev server though.


Hope this helps.
Zagga

1

I hate to correct someone in Public but Zagga is wrong.
<img src="/images/picture.jpg" /> is not based on the current directory but on the Document Root directory for the web site. For example all the sites on my server are located in /var/www/html/ and have their own directory by domain. My web site resides in /var/www/html/txlinux.com/ which is listed as the document root for the site I can refer to any file in the top directory of the site with <img src="/picture.jpg" /> but the absolute path for the files on the server is /var/ww/html/txlinux.com/picture.jpg. The only time I really need to use this form of the path is when using "Include file.php (i.e. Include /var/www/html/txlinux.com/config/config.php )

"./" is the current directory and "../" is one directory up.

Votes + Comments
well done
0

If I am wrong, I am glad people are willing to correct me, or I would never learn :)

What I was trying to do though was point out the difference between an absolute URL (http://www.mysite.com/images/smile.gif) and a relative URL (images/smile.gif).

The example I used (<img src="/images/picture.jpg" />) is not an absolute URL (because it is not the full, unique address to the file) but it does act like one because the first "/" is an instruction to start at the server root, no matter where the current document is.

This doesn't help zer0cool with their problem though.


Zagga

Edited by Zagga: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.