LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-26-2006, 12:29 PM   #1
cavaroni
LQ Newbie
 
Registered: Dec 2006
Posts: 2

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


Hello,

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...

Thanks!
 
Old 12-26-2006, 01:34 PM   #2
derxob
Member
 
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="domain.com/images/image.jpg"> 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, 09:20 AM   #3
cavaroni
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 error...is 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?
 
  


Reply


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 07:30 PM
sharing /var/www/html over samba madsporkmurderer Linux - Networking 3 02-01-2006 10:23 AM
help in /var/www/html/!! chidomen Linux - Newbie 4 01-13-2005 12:02 PM
ownership of /var/www/html haobaba1 Linux - Security 1 08-04-2003 03:58 PM
chmod of /var/www/html alTereD Linux - Security 1 12-16-2002 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:55 PM.

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