What makes up a URL (Uniform Resource Locator)

It is common to find options like input URL in the search bar of the various search engines. URLs are commonly identified as hypertexts used to link to Various Internet pages. But what makes up a URL?

A URL is simply the address of a web page, ftp site, audio stream or any other Internet resource.
A Uniform Resource Locator, as the name suggests, provides a way to locate a resource on the internet. It is a hypertext system that operates over the internet.

Advertisement - Continue reading below

The URL contains the name of the protocol to be used to access the resource and a resource name. The first part of a URL identifies what protocol to use. The second part identifies the IP address or domain name where the resource is located.

A URL is the most common type of Uniform Resource Identifier (URI). URIs are strings of characters used to identify a resource over a network. A URL is used when a web client makes a request to a server for an Internet resource.
A URL is defined as those URIs that identify a resource by its location or by the means used to access it, rather than by a name or other attribute of the resource.

A newer form of resource identifier, the IRI (Internationalized Resource Identifier), permits the use of characters and formats that are suitable for national languages other than English. An IRI can be used in place of a URI or URL when the applications involved with the request and response support IRIs.

Related Article: Top 5 privacy focused Browsers To Have on your Desktop

URL protocols include HTTP (Hypertext Transfer Protocol) and HTTPS (HTTP Secure) for web resources, “mailto” for email addresses, “ftp” for files on a File Transfer Protocol (FTP) server, and telnet for a session to access remote computers.

A URL for HTTP (or HTTPS) is normally made up of three or four components:

A scheme. The scheme identifies the protocol to be used to access the resource on the Internet. It can be HTTP (without SSL) or HTTPS (with SSL).

A host. The host name identifies the host that holds the resource. For example, www.example.com. A server provides services in the name of the host, but hosts and servers do not have a one-to-one mapping.

Host names can also be followed by a port number. Well-known port numbers for a service are normally omitted from the URL. Most servers use the well-known port numbers for HTTP and HTTPS , so most HTTP URLs omit the port number.

A path. The path identifies the specific resource in the host that the web client wants to access.

A query string. If a query string is used, it follows the path component, and provides a string of information that the resource can use for some purpose for example, as parameters for a search or as data to be processed. The query string is usually a string of name and value pairs; for example, term=bluebird. Name and value pairs are separated from each other by an ampersand (&); for example, term=bluebird&source=browser-search.
The scheme and host components of a URL are not defined as case-sensitive, but the path and query string are case-sensitive. Typically, the whole URL is specified in lowercase.

The scheme is followed by a colon and two forward slashes.
If a port number is specified, that number follows the host name, separated by a colon.
The path name begins with a single forward slash.
If a query string is specified, it is preceded by a question mark.
Figure 1. Syntax of an HTTP URL

Here is an example of an HTTP URL:

With a port number specified, the URL is:

A URL can be followed by a fragment identifier. The separator used between the URL and the fragment identifier is the # character. A fragment identifier is used to point a web browser to a reference or function in the item that it has just retrieved. For example, if the URL identifies an HTML page, a fragment identifier can be used to indicate a subsection within the page, using the ID of the subsection. In this case, the web browser typically displays the page to the user so that the subsection is visible. The action taken by the web browser for a fragment identifier differs depending on the media type of the item and the defined meaning of the fragment identifier for that media type.

The URLs used by other protocols might have a different syntax to the one used for HTTP but in brief, above are what makes up a URL.