Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-26-2006, 11:29 AM   #1
LQ Newbie
Registered: Dec 2006
Posts: 2

Rep: Reputation: 0
Unhappy Having problems linking images with relative paths in /var/www/html


New user to the site...I think this site is great! Anyhow...
I am having problems linking images from my index.html to a folder I have created /var/www/html/images. My main index.html located in /var/www/html/index.html. I would like to know how exactly do I link relative paths using the <img src=""> tag, and also the url("") tag for css...I am used to doing it in Windows, but I recently installed 'The Gimp' and Bluefish, which I love but I am having this problem of linking images to nested folders using relative paths for when I upload them onto the net...

Old 12-26-2006, 12:34 PM   #2
Registered: Apr 2006
Location: Los Angeles, California
Distribution: Slackware, Ubuntu
Posts: 68

Rep: Reputation: 15
You could do it a number of ways. One way would be to give the exact location using a direct link, like <img src=""> another way would be to give the folder like <img src="../images/image.jpg"> or you could define a PHP variable for /var/www/html/images/ so you can do something like <img src="IMG_DIR/image.jpg">

Hope this helps.
Old 12-28-2006, 08:20 AM   #3
LQ Newbie
Registered: Dec 2006
Posts: 2

Original Poster
Rep: Reputation: 0
I can use <img src="image.jpg"> and that shows the image...but when I use <img src="../images/image.jpg"> it doesn't show the image...and if I right click and use show image...I get a forbidden 403 there something wrong with my access on apache? I used chmod 777 for both the images folder and the image.jpg itself but still cannot get links to images within nested folders on the root of the apache folder (/var/www/html)...any ideas?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
index.html is not noticed in /var/www/html xviddivxoggmp3 Red Hat 1 04-23-2006 06:30 PM
sharing /var/www/html over samba madsporkmurderer Linux - Networking 3 02-01-2006 09:23 AM
help in /var/www/html/!! chidomen Linux - Newbie 4 01-13-2005 11:02 AM
ownership of /var/www/html haobaba1 Linux - Security 1 08-04-2003 02:58 PM
chmod of /var/www/html alTereD Linux - Security 1 12-16-2002 02:43 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:54 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration