Since the URL concept really pretty simple ("if it's out there, we can point at it"), this beginner's guide is just a quick walk through some of the more common URL types and should allow you to be creating and understanding URLs in a variety of contexts very quickly.
file://ftp.yoyodyne.com/pub/files/foobar.txtThe toplevel directory of this FTP server is simply:
file://ftp.yoyodyne.com/The "pub" directory of this FTP server is then:
file://ftp.yoyodyne.com/pubThat's all there is to it.
gopher://gopher.yoyodyne.com/Some gopher servers may reside on unusual network ports on their host machines. (The default gopher port number is 70.) If you know that the gopher server on the machine "gopher.banzai.edu" is on port 1234 instead of port 70, then the corresponding URL would be:
gopher://gopher.banzai.edu:1234/
news:rec.gardeningCurrently, network clients like NCSA Mosaic don't allow you to specify a news server like you would normally expect (e.g.,
news://news.yoyodyne.com/rec.gardening
); this may be
coming down the road but in the meantime you will have to specify your
local news server via some other method. The most common method is to
set the environment variable NNTPSERVER
to the name of
your news server before you start Mosaic.
A file called "foobar.html" on HTTP server "www.yoyodyne.com" in directory "/pub/files" corresponds to this URL:
http://www.yoyodyne.com/pub/files/foobar.htmlThe default HTTP network port is 80; if a HTTP server resides on a different network port (say, port 1234 on www.yoyodyne.com), then the URL becomes:
http://www.yoyodyne.com:1234/pub/files/foobar.html
http://www.yoyodyne.com/pub/afile.html
), you
can use a partial, or relative, URL to point to another
file in the same directory, on the same machine, being served by the
same server software. For example, if another file exists in that
same directory called "anotherfile.html", then
anotherfile.html
is a valid partial URL at that point.
This provides an easy way to build sets of hypertext documents. If a set of hypertext documents are sitting in a common directory, they can refer to one another (i.e., be hyperlinked) by just their filenames -- however a reader got to one of the documents, a jump can be made to any other document in the same directory by merely using the other document's filename as the partial URL at that point. The additional information (access method, hostname, port number, directory name, etc.) will be assumed based on the URL used to reach the first document.
The current IETF URL spec is here; more information on URLs can be found here.