What is an URL?
URL stands for Uniform Resource Locator. An URL is a reference to a unique resource on the internet. It can be thought of as the address of a resource such as a website address.
URL’s include a protocol identifier which specifies the name of the protocol that is used to locate the resource. The resource name is the complete address to the resource. An example of a protocol is the HTTP (Hyper Text Transfer Protocol). This protocol is used to access hypertext document resources. Other protocols include file transfer (ftp), database access (JDBC) and email (mailto).
An example of a Uniform Resource Locator is: http://www.digitalshiftmedia.com/index.html.
Components of an URL
The format of the resource name depends entirely on the protocol used. Many formats contain one or more of the following components:
- hostname – the specific domain name of a specific host computer or device connected to a network. For example, “www.digitalshiftmedia.com” is the hostname.
- filename – the pathname or simply, the path to the device file. For example, for “www.digitalshiftmedia.com/example/url/index.html” is the filename is everything after the .com.
port – the port number is associated with a TCP/IP address. The port identifies the address and specifies executable services that are shared by the applications of a device. Ports are used for scenarios like software development environments and therefore not used by the average user. For example, the address “http:localhost:123/” uses TCP port 123.
- reference – identifies the location of a specific anchor within a file of a resource.
Requirements of Protocols used for URLs
Protocols require the use of a hostname and filename, however, port numbers and references are optional. For example, the resource name for an HTTP URL specifies the server on the network (hostname) as well as the path to the document on that machine (filename). The HTTP URL can also specify a port number and a reference.