How do you give an address to some resource on the Internet? URL.
Universal Resource Locator (URL) is basically the unique address for a resource
on the Internet.
General structure of the URL is the following:
scheme://hostname[:port]/path/filename
Where scheme is basically protocol, by which resource should be
accessed. Depends on the scheme the URL can look a differently, here
is the list of the most commonly used schemes:
http - HyperText Transfer Protocol (WWW server protocol), the
most used one.
The format of this type of URL is: http://[user:password]@hostname[:port]/path/filename[#label|parameters],
where:
user & password - Username and password for http
authentication. They are optional and in most cases are not used. It's
also not a good idea to use them in the URL because of security problems
it may cause. If omitted and resource requires authentication, user will
be prompted.
hostname - Hostname of the computer where resource is residing.
If ommited, the current hostname is used (the one of the current URL).
port - port number, by default 80 for http.
path - path to resource inside the computer. If omitted,
current path is used. Note, that if hostname is omitted you can use the
relative path instead of the full path, which is very usefull feature if
you need to build the documents and need easily move them to other place.
e.g.: in document http://www.company.com/misc/main.html you need to link
to http://www.company.com/misc/part1/chapter1.html, so instead of using the
full URL you can use just "part1/chapter1.html".
filename - filename of the resource, if omitted, index.html
is used (it's actually configurable in httpd config files)
label - label inside the file, used to position the browser
inside the file
parameters - CGI parameters that can be specified (GET method).
All of these fields are actually optional, in case if field is omitted
default is used. Note: That it's better to use URLs with as fewer fields as
possible, because it allows you to build much more portable documents.
For example if you put in you document the full path and you need to
move it some place else, you'll have to change all the URLs inside your
documents. But if you use the relative path (without
hostname & and with relative path instead of the absolute one,
most likely you won't need to change anything.
ftp - File Transfer protocol
ftp://[user:password]@hostname[:port]/path/filename,
where the meaning of the fields is similar to the http protocol.
mailto - Send e-mail
mailto:address - this will open new message
in your e-mail composer (netscape).