In more detail
A full URL has several parts: https://example.com:8080/docs/page?lang=en#intro. That is the scheme (https), host (example.com), port (8080), path (/docs/page), query string (lang=en) and fragment (intro). Characters that are not allowed, such as spaces, are written as percent codes, for example %20. Only the scheme and host are required: the port defaults to 80 for http and 443 for https, and the path to /. Relative URLs such as ../img/logo.png are resolved against the current page, and the fragment is never sent to the server.
Why it matters
The scheme and host are case-insensitive, but the path usually is not, so /About and /about can be different pages. Attackers exploit the rarely used userinfo part: in https://[email protected]/ everything before the @ is a user name, and the real host is attacker.example.
Example
Break a URL into its parts with the URL Parser, and encode or decode special characters with the URL Encode and URL Decode.
Common confusion
A domain name is just the host part; the URL adds the scheme, path and everything after it.