4 ms·
I've been making websites for almost 30 years now. I still don't know the difference between URI and URL. I'm starting to think it doesn't matter.
by 90s_dev 1y ago
I've been making websites for almost 30 years now.
I still don't know the difference between URI and URL.
I'm starting to think it doesn't matter.
- diggan 1y ago> I still don't know the difference between URI and URL. One is a location, the other one is a ID. Which is which is referenced in the name :) And sure, it doesn't matter as long as you're fine with referencing locations rather than the actual data, and aware of the tradeoffs.
- Sesse__ 1y agoIt doesn't matter. URI is basically a format and nothing else. (foo://bar123 would be a URI but not a URL because nothing defines what foo: is.) URLs and URNs are thingies using the URI format; https://news.ycombinator.com https://news.ycombinator.com is a URL (in addition to being a URI) because there's an RFC that specifies that https: means and how to go out and fetch them. urn:isbn:0451450523 (example cribbed from Wikipedia) is an URN (in addition to being an URI) that uniquely identifies a book, but doesn't tell you how to go find that book. Mostly, the difference is pedantic, given that URNs never took off.
- 90s_dev 1y agoIt's almost like URNs were born in an urn! [1] [1]: ba dum tss
- account42 1y agoToo bad that URLs and URNs are generally distinct subsets. It would be better if URLs also uniquely identified the resource they are pointing to so you could find it elsewhere if the original location goes away.
- marcosdumay 1y agoAn URI is an standard way to write names of documents. And URL is an URI that also tells you how to find the document.
- layer8 1y agoURLs in the strict sense are a subset of URIs. They specify a mechanism (like HTTP or FTP) for how to access the referenced resource. The other type of URIs are opaque IDs, like doi:10.1000/182 or urn:isbn:9780141036144. These technically can’t expire, though that doesn’t mean you’ll be able to access what they reference. However, “URL” in the broader sense is used as an umbrella term for URIs and IRIs (internationalized resource identifiers), in particular by WHATWG. In practice, what matters is the specific URI scheme (“http”, “doi”, etc.).
- immibis 1y agoA URL tells you where to get some data, like https://example.com/index.html https://example.com/index.html A URN tells you which data to get (usually by hash or by some big centralized registry), but not how to get it. DOIs in academia, for example, or RFC numbers. Magnet links are borderline. URIs are either URLs or URNs. URNs are rarely used since they're less practical since browsers can't open them - but note that in any case each URL scheme (https) or URN scheme (doi) is unique - there's no universal way to fetch one without specific handling for each supported scheme. So it's not actually that unusual for a browser not to be able to open a certain scheme.