Roughly speaking, a URL specififies a file in any format (HTML, a picture file, an ASCII file, anything) by naming the machine it's on, the subdirectories it's in, and the name it has; a file can be obtained thru any protocol (http, gopher, anonymous ftp).
Here are some examples and explanations:
http://www.csun.edu/~sburke1/sburke1.html
gopher://netcom.com/0info.txt
0info.txt in the
gopherroot directory of the Internet machine netcom.com
Gopher URLs can be kind of peculiar, and there a
few things you might want to know about them.
mailto:sburke@cpan.org
news:alt.rec.gardening
telnet://huey.csun.edu:23/
mailto:joe%3dbob%25briggs@chainsaw.int,fifi@god.org
joe=bob%briggs@chainsaw.int
and fifi@god.org. Note that the % and = are %-encoded;
it's very very unlikely you'll ever have to worry about %-encoding.
Note that there is no space between the addresses; this is because
there are never any spaces in URLs, ever ever ever.
<A HREF="mailto:me@nowhere.org">mail me, dood!</A>.
Instead, say
mail me, dood, at
<A HREF="mailto:me@nowhere.org">me@nowhere.org</A>
so people who can't (or don't want to) mail you thru their browser can
copy your address from the browser window (or real-world store it on paper,
post-it, Lite-Brite, Magic Slate, whatever) and paste it into their
mailer program.
http://www.csun.edu/ITR/library/images/dude2.gif
ftp://ftp.netcom.com/~eamon/test1.wav
file://localhost/c|/netscape/bookmark.htm
Two other, esoteric, protocol schemes -- wais:// and prospero:// -- are supported in theory, but not in practice. No one seems to mind this.
The URL form news:newsgroup is popular, although not
yet universally adopted; many browers cannot support it, and others
prefer/require different syntaxes.
Adding finger:address@host was suggested, but is not
supported by any client I know. However, there is a
very elegant workaround.
/
Example:
http://www.csun.edu/ITR/
http://www.ling.nwu.edu/~sburke, the server will respond
with a redirect code meaning "What you actually want is to be found at
http://www.ling.nwu.edu/~sburke/". Your client
will then ask for
http://www.ling.nwu.edu/~sburke/, at which point
the server will respond with the directory
blocker file for that directory, or lacking such a file, a listing
of all the files in that directory.
If you had told your client to jump to
http://www.ling.nwu.edu/~sburke/ in the first
place, it would have saved the useless initial exchange of packets.
This may seem trivial if the server is 500 feet away from your client
across a clear Ethernet network, but if you're in the USA and the
server is in China, every packet can be a long wait.
What this means is that if you're making links to other people's pages in a document of yours, don't abbreviate the URLs by leaving the final /'s off the directory names; put them in.
Of course, this is
not relevent if the URL ends in a filename (e.g.,
foo.html), nor is it relevent for ftp or gopher URLs.
http://www.csun.edu/~sburke1/sburke1.html#tools
guide1.html
abouturl.html#drstupid
test1.gif
#stuff" jumps you to a where in the
current document there is a <A NAME="stuff">... </A>
(BTW, if you want text to be a link and and anchor, do it
like this:
<A NAME="stuff" HREF="foo.html">... </A>
These are called relative URLs. Relative URLs and anchors are very well explained in Beginner's Guide to URLs and the Strict Guide's section on URL Errors. (So I don't have to do it here, yay!) Refer to these documents.
I refer to it often.