A URL (Uniform Resource Locator) is an address that users use to find a resource on the internet. URLs are used in browsers to open web pages, download files, open videos and images, send requests to the server, and perform other operations. They consist of a specific set of letters and numbers that are fixed to each resource and are unique.
To use a URL, the address is entered into the browser's address bar. The browser then sends a request to the server that stores the resource and receives a response with the content of the page or file. URLs are made up of several parts, which include characteristics of the resource.
- The protocol is the first part of the URL, which specifies how the browser should access the resource. For example, the http, https, ftp, and file protocols define different ways of accessing the resource.
- The domain name is the hostname where the resource is located. For example, google.com, facebook.com, or wikipedia.org. In addition to the domain, an IP address may also be used.
- The path is part of the URL that indicates the location of the resource on the server and comes after the domain. It may contain information about a specific file or directory on the server. Often, the URL of a page ends with this part, but sometimes other elements are added to the address.
- Parameters are part of the URL that contains additional information about the website and sends instructions to the server. For example, parameters determine the language of the page if the site is multilingual.
- The anchor is the part of the URL that points to a specific location on the page when it is divided into sections. Thanks to the anchor, the user not only lands on the page but also moves directly to one of its parts.
For example, the URL of a web page looks like this: https://www.example.com/index.html. Here, https indicates the protocol, www.example.com is the hostname, and index.html is the location of the file on the server.