.H3 "Uniform Resource Locator"
.Pn URL
.X "Uniform Resource Locator"
.X "URL"
.X "Uniform Resource Identifier"
.X "URI"
Another term has become widely known in connection with the World Wide Web: the
concept of a \fIUniform Resource Locator\fP\| or \fIURL\fP.  Nowadays a URL is a
special kind of \fIUniform Resource Identifier\fP\| or \fIURI\fP.  They're
defined in RFC 2396, which you can find at
\fIhttp://www.ietf.org/rfc/rfc2396.txt\fP.  The most usual kind of URL can
consist of up to 6 components, although most contain only 3.  The syntax is
(roughly translated into UNIX terminology):
.Ds
\fIservice\fP\|://\fIuser\fP\|:\fIpassword\fP\|@\fIhost\fP\|:\fIport\fP\|/\fIpath\fP\|
.De
These names have the following meaning:
.br
.ne 1i
.TB "URL syntax"
.TS H
tab(#) ;
lf(I) | lw52 .
Component#Meaning
_
.TH
.X "/etc/services"
service#T{
Usually an IP service, described in 
.File /etc/services .
See page \*[services]
for more details.  Some exceptions are the string \f(CWmailto\fP, which
identifies the \fIuser\fP\| and \fIhost\fP\| components as a mail ID, and
\f(CWfile\fP, which identifies the following pathname as the name of a local
file.  The most common services are \fIhttp\fP, \fIhttps\fP, \fIftp\fP\| and
\fItelnet\fP.
T}
.sp .4v
.X "/etc/passwd"
user#T{
The name of a user on whose behalf the operation is performed.  For example,
when using the \fIftp\fP\| service, this would be the user name to use for
logging in to the FTP server.  We've seen that it represents the name of the
recipient for mail.  From a UNIX perspective, the \fIuser\fP\| information comes
from 
.File /etc/passwd .

T}
.sp .4v
.X "/etc/spwd.db"
password#T{
Where authentication is needed, the password to use.  You'll see this
occasionally in FTP URLs.  Traditionally, this information is stored in

.File /etc/passwd ,
but FreeBSD stores it in a separate file, 
.File /etc/spwd.db ,

which is accessible only to \f(CWroot\fP.
T}
.sp .4v
.X "/etc/namedb/db.domain"
host#T{
The DNS name of the system on which the resource is located.  Some non-UNIX
sites also use an IP address here.  This information is stored in a file such as

.File /etc/namedb/db.domain
for the local system, and retrieved via DNS.
T}
.sp .4v
port#T{
The port number to connect to.  This may be necessary if the service uses a
non-standard port.  Normally it's implicit in the service: for example,
\f(CWhttp\fP usually runs on port 80, but it's possible to run web servers on
other ports, in which case you need to specify the port number here.
T}
.sp .4v
.X "/usr/local/www/data/"
.X "~user/public_html/"
path#T{
A UNIX path name, in other words a complete file name.  Unlike other UNIX path
names, the root is not normally the root file system.  For the \fIhttp\fP\|
service, the root is implementation defined.  For Apache on FreeBSD, it's
normally 
.File /usr/local/www/data/ .
If you use the \f(CW~\fP\| notation to mean
\fIhome directory\fP\| (see page \*[home-directory]), you will get

.File ~user/public_html/ .

.P
For \fIftp\fP, it's the directory which belongs to \fIuser\fP.  If you omit
\fIuser\fP for \fIftp\fP, you'll get the user \fIftp\fP, so the pathname

.File /pub
maps to the UNIX file name 
.File ~ftp/pub .

T}
.TE
.sp 1.5v
Normally, you don't specify user name, password or port, so URL syntax reduces
to:
.Ds
\fIservice\fP\|://\fIhost\fP\|/\fIpath\fP\|
.De
Note that one character is not defined in URI or URL syntax: the backslash,
\f(CW\e\fP.  The directory delimiter is a slash (\f(CW/\fP), but many Microsoft
clients and even servers don't notice that, and some even translate \f(CW\e\fP
into \f(CW/\fP without telling you.  That makes it difficult to view web sites
like \fIhttp://www.lemis.com/why\ebackslashes\eare\enot\eslashes.html\fP.
