Comprehensive URL Overview

View in Browser. You don't need to read the source code for this example.

Relative URL - Location of another file, relative to the current one.

   ../folder/file.html
Of course, this is how we link files together internally within a Web site so that the site is portable, meaning the links will work regardless of where the web site is hosted because the URL only use internal, relative paths entirely within the web site.

Hosting Root URL (not a relative URL)

   /file.html
You can't begin a relative URL with a / like above because a single leading / resolves to the root directory of the entire web server (http://csci.lakeforest.edu in our case.)
So a hosting root URL like href="/file.html" resolves to http://csci.lakeforest.edu/file.html

URLs like below are useful when using Server-Side Includes since they resolve accurately from anywhere within your site, including within subfolders.
   /~yourusername/csci270/
The URL just above resolves to http://csci.lakeforest.edu/~yourusername/csci270/   (because /~yourusername resolves to your public_html folder).

URL Fragment - Points to a location in a page.

   #unique_id      (as in href="#unique_id")
This resolves to an HTML element in the SAME page that has id="unique_id", bringing it to the top of the browser window.

A URL fragment can be added onto the end of ANY type of URL. For example, the following will both load the Wiki page AND pull the Migration section to the top.
https://en.wikipedia.org/wiki/Wildebeest#Migration

File System URL - The absolute location of a file on a PC

You have seen Absolute URLs like the following when loading files into your browser directly from your hard drive.
   file:///Users/smith/Documents/file.html   (or C:\.... in Windows)
This URL is only valid on that person's PC.

Absolute URL - The absolute location of a file on the WWW

   http://csci.lakeforest.edu/file.html
http (HyperText Transfer Protocol) indicates delivery of a WWW resource. Web server keeps connection alive to also transfer images, stylesheets, etc.

Absolute URL - Secure Delivery

   https://csci.lakeforest.edu/file.html
This is exactly the same, but all the packets are encrypted by the TCP layer during transit. (Won't work unless the server is configured for secure transactions.)

Absolute URL - Protocol Neutral (http or https)

   //csci.lakeforest.edu/file.html
A browser will adapt to either http or https depending on whether the original connection was secure or not.

Query String - Sends data to the Web server.

https://www.google.com/search?q=wildebeest&sourceid=chrome&ie=UTF-8
In this example, the query string is data sent to Google to search for Wildebeest. In general, when an HTML form is submitted to the server, the form's data can be sent as a query string. Of course, that data would need to be processed by a server-side script (PHP or otherwise).