Using Universal Resource Locators

Universal Resource Locators, or URLs, are very familiar to anyone who has spent a little time surfin’ the ’net. Most people assume that URLs are useful only when dealing with web pages; however, a URL is truly a universal tool because it allows you to specify the location of nearly any resource on the Internet. It encompasses most Internet protocols and even allows you to include user names and passwords when that information is required.

The format of a URL is:

<protocol>://[<user-info>]<host>[<port-info>]/[<url-path>]

where:

  •  <protocol> specifies the protocol and can be any of the following: FTP, HTTP, GOPHER, MAILTO, NEWS, NNTP, TELNET, WAIS, or FILE.

  • <user-info> is optional and is used to specify a user name or user name and password. A user name is specified by username@, and a user name and password are specified by username:password@. If this parameter is not specified, then the user name and password will default to a server-supplied value.

  • <host> is the domain name or IP address of the machine you wish to access.

  • <port-info> is optional and takes the form of :<port-number>. If this parameter is not specified, it will default to the well-known port value for the specified <protocol>.

  • <url-path> is also optional and usually consists of a fully qualified path name for a file. Note that other information may be included as part of the <url-path> such as parameters for a CGI-BIN script or additional information such as ;type=typecode for an FTP transfer.

NOTE:Web browsers and more: In addition to the HTTP protocol, most web browsers can access FTP sites and Gopher sites. More complex packages such as Internet Explorer also support the News, NNTP, and MailTo protocols through the use of integrated tools like Outlook. Usually, if you don’t specify a protocol, the browser will assume that you want to use HTTP.

© 1998 SYBEX Inc. All rights reserved.