A URL can be specified with a varying degree of absoluteness. So several URL strings can resolve to the same resource. Also, a single URL can resolve to different resources depending on the server or directory of the linking resource.

I have some terminology to synchronize some brainwaves. The linking resource is the document that contains the URL to be resolved. To resolve is to locate and to load the linked resource. The linked resource is the specific document or resource to be loaded based upon the URL.

To avoid some common pitfalls, I state the following best practices on the choice of absoluteness in my URLs.

Ways to start a URL

Absolute URL
protocol://server/dir1/dir2/filename
For any resources where the protocol is critical to maintain the desired results.
Specifies the full absolute URL and is equal to the resolved URL before server redirects (if any).
Protocol relative URL
//server/dir1/dir2/filename
For any resources hosted on a separate server.
Specifies the location of the linked resource relative to the currently active protocol of the linking resource.
Looks like an absolute URL, except omits http: or https: from the start.
Relative URL with an absolute path
/dir1/dir2/filename
For local resources in an established location on the server.
Specifies the location of the linked resource relative to the server of the linking resource.
Looks like a protocol relative URL, except omits //server from the start.
Relative URL with a relative path
dir1/dir2/filename
For local resources whose location is only established relative to the linking resource itself.
Specifies the location of the linked resource relative to the directory of the linking resource.
Looks like a relative URL with an absolute path, except omits / from the start.
Each directory name ends with a / and besides using directory names, I can use ../ to refer to the parent directory and I can use ./ to refer to the same directory just like accessing local directories on my system.
Fragment identifier
#identifier
For referencing a particular section of text within the same document.
Specifies only the ID attribute of an element within the resource. The linking resource is the linked resource so it is relative to the current document and absolutely within the document.
Omits the whole URL from the start (even up through the filename), so the linking resource must be the same as the linked resource (same document).
Besides ID references, I can use #top to refer to the top of the document and I can use # as a placeholder URL to represent that some other action besides navigation would happen within the same document.

Ways to end a URL

Any of the above ways of starting a URL may have a modified ending, as follows. My examples below show the protocol relative URL because it is my personal favorite.

Remove the filename from the URL
//server/dir1/dir2/
For resources that represent the directory as a whole and whose file name should be determined by the server defaults.
Specifies the location of the linked resource as the directory itself.
Looks like any other kind of URL above, except omits filename from the end.
Add a query string with a single attribute to the URL
//server/dir1/dir2/?timestamp=TIME
//server/dir1/dir2/filename?first=5
For resources whose view or behaviors vary based upon a query string.
Specifies a name-value pair pertaining to the linked resource.
Looks like any other kind of URL above, except adds ?varName=value to the end.
One notable use of a query string is to bypass browser cache by force (as shown).
Add a query string with multiple attributes to the URL
//server/dir1/dir2/?first=5&second=Hello
//server/dir1/dir2/filename?first=5&second=Hello&third=Bye
For resources whose view or behaviors vary based upon a query string.
Specifies more name-value pairs pertaining to the linked resource.
Looks like any other URL ending with a query string, except adds &anotherName=anotherValue to the end.
Add a fragment identifier to the URL
//server/dir1/dir2/#identifier
//server/dir1/dir2/filename#identifier
//server/dir1/dir2/?first=5&second=Hello#identifier
//server/dir1/dir2/filename?first=5&second=Hello#identifier
For referencing a particular section of text within the linked resource.
Specifies the ID attribute of an element within the linked resource.
Looks like any other kind of URL above, except adds #identifier to the end so the browser would scroll to put the element with ID=identifier at the top of the window once the resource was loaded.

HTML5 attributes which contain URLs

These attributes correspond to particular elements whose functioning pivots on the specified URLs within these attributes.

action
May apply to the form element. Default is the current document. A URL to target for submitting the form.
cite
May apply to q or blockquote elements. A URL to the source being quoted.
May apply to ins or del elements. A URL to more information about the edit.
content
Must apply to meta elements if http-equiv=refresh. Sets automatic refresh rules of the document.
Integer
Non-negative integer specifies number of seconds before automatically refreshing the document.
Integer; URL = New-URL
The Integer and URL specify the number of seconds before automatically navigating to a document.
data
May apply to object elements. The URL for component data.
formaction
May apply to input (if type=submit or type=image) and button (if type=submit) elements. Default is to inherit the action attribute from the form if unspecified. If specified, overrides form's action attribute value when the form is submitted from that button.
href
Must apply to a, area, and link elements. The URL of the linked resource.
manifest
May apply to the html element. Affects early loading behavior.
src
Must apply to audio and video elements or else have at least one source child element to find and play the resource for download.
Must apply to img, input (if type=image), source and track elements. The URL of the resource.
Must apply to embed elements with no type attribute, and may apply to embed elements with the type attribute. The URL of the resource.
Must apply to iframe elements to have a URL for the document or else may apply as fallback for the srcdoc attribute.
May apply to script elements. Default is the content of the element embeds a script if unspecified. If specified, a URL for a script, causing the content of the element to be ignored.
archive
codebase
classid
May apply to object elements. Not part of the HTML5 standard so I avoid.
longdesc
May apply to img elements. Not part of the HTML5 standard so I avoid.
profile
May apply to the head element. Not part of the HTML5 standard so I avoid.