URL
A URL is the address a browser or another program uses to find a resource, such as a web page, image, or file. A URL can also tell the program how to reach that resource and which part of it to show.
What does a URL look like?
Consider this complete web address:
https://shop.example.com/products?category=books#new
Each part has a different role:
https://is the scheme. It tells the browser which kind of connection to use. For a web page, the common choices arehttpsandhttp.shop.example.comis the host named in the address.shopis a subdomain of the domainexample.com; it helps identify the particular service or site being reached./productsis the path. It identifies the requested resource within that service. It looks like a folder or file path, but it does not have to match a real folder or file on the server.?category=booksis the query. It gives the service additional information. In this example, a shop might use it to show books. The service decides what the query means; another site could use the same text differently or ignore it.#newis the fragment. A browser can use it to jump to a marked part of the page. The browser does not send the fragment to the web server as part of the request.
Some addresses omit parts. For example, https://example.com/ has a scheme, host, and path, but no query or fragment. A port number can also appear after the host, such as :8443; it tells the browser which network connection point to use. Most visitors do not need to type a port because common web connections use default ports.
How does a URL help open a page?
When Alex sends a friend https://example.com/about, the browser reads the address to work out how to request the About page. It uses the https scheme for a secure web connection, looks up the host example.com, and asks for the resource identified by /about. A website may return a page, redirect the browser to a different address, or report that the requested page is unavailable. The URL identifies what the browser is trying to reach; it does not guarantee that the resource still exists or will load successfully.
URLs also appear in links, image addresses, and other places where software needs to identify a resource. Not every URL is a web page address: for example, mailto:alex@example.com is an address that can open an email program. The scheme tells the program how to interpret the address.
How is a URL different from a domain?
A domain is only one possible part of a web URL. In https://shop.example.com/products, the host is shop.example.com, while the domain registered for the shop might be example.com. The scheme and path also matter: http://example.com/ and https://example.com/products use the same domain but tell the browser to make different requests. A domain by itself is often enough for a person to recognize a site, but a full URL can point to a particular page or resource.
Does HTTPS make every URL safe?
No. https means the browser uses an encrypted connection to the site named in the address, but it does not prove that the site is honest or that its content is harmless. A misleading site can use HTTPS too. Check the host name carefully, especially when a link asks for a password or payment.
Related terms
- Domain name — a readable name that can form part of a web address
- Subdomain — a name such as
shopplaced before a domain - HTTPS — the secure web connection scheme used in many URLs