How it works
Usually a URL consists of the following parts:
- A protocol, also known as a scheme which should be used for working with a website. Generally, it’s HTTP or HTTPS. One of these two protocols is required to address web pages, but there are also other schemes. For example, mailto (to open a mail client) or ftp (to transfer files).
- A host which is a full domain name or an IP address.
- A path to a specific website page. This is important if you are not on the home page.
- Parameters setup. Due to parameters, the website’s content is presented to you according to your query.
- An anchor. It directs to a certain part of the web page. Through the anchor a browser understands what it should show to a user.
Nominally, a URL can be of any length, but browsers aren’t limitless. There is an unspoken rule: a URL shouldn’t be longer than 2048 characters. For example, Internet Explorer has such a rule.
The use of URL
The most popular way of using a URL is to type it in the address bar. However, there are many other ways to use it in HTML. For example, you can use a URL to create links to other documents, to link files with their resources, to display different types of multimedia and other HTML pages on a web page and more.
By the way, back in 2009 the creator of URL Tim Berners-Lee said that there is no need for a double slash which follows the protocol indicator. You can try to type a URL without it right now, and it should work out.