Absolute and Relative URLs

and their relevance to the UTCD project

The essential difference between absolute and relative URLs is that absolute URLs completely and unambiguously specify the location of the Web page or other Web resource, whereas relative URLs specify the location relative to the current page, or relative to the server from which the page was accessed.

Absolute URLs

An absolute (or full) URL will be similar to:
   http://www.utexas.edu/student/recsports/index.html
This url has a protocol (http), the name of a Web server (www.utexas.edu), and specifies which file to retrieve from the server (/student/recsports/index.html). Another absolute URL is:
   ftp://ftp.utexas.edu/pub/mac/graphics/graphicconverter-25-fat.hqx
This URL specifies the ftp protocol (your web browser will connect to an ftp server rather than a Web server), the server name of ftp.utexas.edu, and the file /pub/mac/graphics/graphicconverter-25-fat.hqx.

Relative URLs

A relative (or partial) URL specifies only part of this information. Characteristically their meaning depends on the location of the page from which they are accessed. For URLs within your section of the UTCD, use relative URLs of the type shown in examples 1-6. Do not use URLs with leading /'s as shown in example 7. For material outside of your area, always use absolute or full URLs. A relative URL can refer to:
  1. A file in the same folder or directory:
      SomeFile.html
    
  2. A file in the parent directory:
      ../SomeOtherFile.html
    
  3. A file several levels up in the directory structure:
      ../../../SomeFile.html
    
  4. A file in a subdirectory
       SomeDirectory/SomeFile.html
    
  5. A file much deeper in the directory structure
       SomeDirectory/AnotherDirectory/YADirectory/SomeFile.html
    
  6. A file somewhere else in your directory structure
       ../../SomeDirectory/SomeImage.gif
    
  7. A file on the same Web server
      /SomeDirectory/SomeOtherDirectory/SomeFile.html
    
    This URL works only when accessed from a Web page on the www.utexas.edu server. This form of URL must not be used on the CD

A special note about CGI programs

While CGI programs can be referred to by a local URL (for example "../cgi-bin/mail.cgi" or "/cgi-bin/mgate.cgi") they are not usable as part of the UTCD. CGI programs require a server to function. Because UTCD files are loaded directly from the CD by the Web browser, CGI programs will not work from the CD. If you have a CGI program that is of special interest to incoming students, use an absolute URL to point to it, and remember to mark it as an external link.