A URL (Uniform Resource Locator) is composed of several parts:
1. Protocol – It indicates the protocol used to access the resource. For example, HTTP or HTTPS.
2. Domain Name – It is the website address or web server that hosts the resource. It can be a combination of letters, numbers, and hyphens. For example, www.example.com.
3. Path – It is the location of a specific resource on the server. It can be a folder or file name. For example, /blog/article.
4. Query parameters (optional) – They are used to pass additional information to the server. They are separated from the rest of the URL using a question mark (?) and separated by an ampersand (&). For example, ?category=sports&year=2021.
5. Fragment identifier (optional) – It is used to identify a specific section of the page. It is indicated by a hashtag (#) followed by the section name. For example, #gallery.