Link to USGS home page
Internal USGS Access Only

URLs

Uniform Resource Locators, URLs, are the addresses of resources on the part of the Internet known as the World Wide Web.

Examples of Absolute URLs:

  http://water.usgs.gov/usgs/www.html
    — typical http example

  http://water.usgs.gov/lookup/geturl?owq
    — http request with a query

  https://some.bank.com/funds
    — secure http request

  ftp://water.usgs.gov/pub/esri_futures.ps
    — ftp url

  mailto:jemiller@usgs.gov
    — electronic mail addresses

The general syntax is:
  scheme :// hostname [ path ? query ]

There are no spaces in a URL. The hostname in a URL is not case-sensitive, but everything else is (or might be!).

Examples of other schemes are:   gopher, news

Relative URLs

Relative URLs are used only within web documents and work much like relative pathnames. They are taken relative to the URL of the document in which they occur.

Examples of Relative URLs:

  file.html
  ../stuff.html
  ../images/fuzzy.gif
  sub/directory/from/here/info.htm
  /usgs/water/drip.html

The last example has no hostname, but uses an absolute path.

It is almost always preferable to use relative links when possible, there are fewer things to correct should the site change.

URLs That End With a Directory Name

If a URL ends with a directory name, the Web Server will check to see if there is a index file in that directory, usually named something like index.html, index.htm, default.htm, default.asp, etc.. and display that file. If such a file does not exist the Web Server may display a listing of all the files and that directory, depending how access is configured.

It is bad form to reference a URL ending in with one of index file names above. These filenames are unneeded, and it marks you as a Web amateur.
For example, use:
    http://water.usgs.gov/   and not
    http://water.usgs.gov/index.html

slide 5


[up]
"Mastering a Web Site" online course
Created and maintained by Lorna Schmid and David Boldt.
http://water.usgs.gov/usgs/training/webmaster/uri.html    
Last modified: Tue Oct 14 16:25:22 EDT 2003