URL Anatomy

The following schematic displays the components of a fictional URL, with color coded parts, from zoglair's point of view:

URL Schematic

 

protocol
For the purpose of this discussion, it can be either http or https. The trailing “s” denotes the secure version of the Hypertext Transfer Protocol. Zoglair handles this transparently, so it supports both versions.
host
This is the name of the server, hosting the requested resource. It consists of a required domain and an optional subdomain. The most popular subdomain is www, but it can be anything or nothing.
Note that zoglair can be configured to serve different content depending on the host, domain or subdomain!
path
This part is whatever follows the domain, up to the question mark (if exists) or the hash symbol (if exists) or the end of the URL. Please notice that the first slash after the domain is technically part of the path (it means the document root). If it is omitted (eg: http://www.zoglair.org), the browser will automatically attach it and in any way the host will respond as if it was actually entered. So, the minimum path is a slash.
Zoglair recognizes the following parts in a URL path (all optional, but in this order):
  1. domain
    A zoglair (sub)domain prefixed with a tilde, in case of a "soft" multi-domain configuration.
  2. language
    A two-character ISO-639-1 language code, in case of a multi-lingual configuration.
  3. unit
    The name of the unit (~controller) responsible for the following node.
  4. node
    The name of the node (~resource) requested
  5. mime
    The response content type, if the unit is capable of generating content in more than one types.
query
The presence of a question mark denotes the start of a query string that extends to the hash symbol (if exists) or the end of the URL. Neither the question mark nor the hash symbol are part of the query. They are delimiters.
A query string is used for passing parameters (~arguments) to the script that processes the URL path. It consists of one or more pairs of field names and values, separated by an equal sign and delimited by an &.
In zoglair (for security reasons) field names are always three lowercase Latin characters long, and field values are mostly numeric. If they are not numeric, there are always certain conditions and restrictions that apply.
fragment
This part is not actually processed by the host. In fact, a web server never sees the light of it! When a user enters such a URL, the browser will cut the fragment out, send the rest of the URL to the server, wait for the server's response, render the document and then search it for an anchor (internal page link) named after the fragment. If one is found, the document will be scrolled so that the anchor aligns to the top of the window.
Anchors and fragments are generated by zoglair automatically.
(C) Nick B. Cassos - All Rights Reserved
powered by zoglair
page generated in 32ms (11 queries, 7ms)