Why can't I fix this link?

I’m building a very simple website for some of my photos.

I’ve got webspace at sunflower.com.

I got CuteFTP, uploaded the picture (scarf.jpg) to ftp.sunflower.com/public_html, hich is the same folder as my index.html page.

When I try to link to it with the img src tag, I get “http://www.sunflower.com/~(my username)/ftp.sunflower.com/~(my username)/public_html/scarf.jpg”

I want it to link to the ftp site (right?) and not the http site. Or am I totally wrong on this?

It should be "http://www.sunflower.com/~(your username)/scarf.jpg

If you are trying to put the image on your index page, all you need is “scarf.jpg”, because it is in the same directory as the page.

The way many ISPs work it is that to log in/upload one must use the ftg.* address but to link to it requires using the www.* address.

Ergo, you are wrong (but not really totally). The link should be to the www.* address. Note that a link within a page on your site can skip the whole site name part entirely and give a relative link. That makes your web page more “portable”.

It should be <img src=“http://www.sunflower.com/~(my username)/public_html/scarf.jpg”>

Wow, first I mistype “ftg” for “ftp” and then the server auto-inserts links for the stuff beginning with 3 ws.

I knew it was something REALLY simple I was missing. I thought I had to link to the ftp site.

Thanks for promptly answering. :slight_smile:

Since the file is in the public_html folder (along with the index page) I didn’t have to put the public_html/scarf.jpg. But, if I want to put all my pictures in a folder called, say, “photos” I would, right?

(I’m so new at this stuff)

This is basically due to different frames of reference to the same file system. It’s not very hard, but if you don’t understand it it’s going to make building a web page pretty difficult from the get-go.

I have a server with files on it. My home directory on it is /home/nanoda, and I have many files and sub-directories in it.
If I had ftp running, I imagine connecting to “ftp://my.ip” with username “nanoda” would put me in to “/home/nanoda”.

Most web server expect people to put their files in a special subdirectory, like “public_html”, 'cause I certainly don’t want my web server handing out any file I should happen to own. Thus, connecting to “http://my.ip/~nanoda” shows the files from /home/nanoda/public_html.
If I want an image subdirectory, it’ll be “/home/nanoda/public_html/images”, and accessable from “http://my.ip/~nanoda/images/”.

Basically, the “public_html” directory is so you can be assured that only stuff you put in there will be publicly accessible, and it’s the root, or starting place for the structure of your URL.