An example of a not-so-great URL design: Amazon product links have an optional slug before everything else like `{slug}/dp/{id}`. So you end up copying a gigantic URL everytime you wish to share a product unless you use the share product button to get the shortened link.
I think this is actually a really great design in that the name of the product can always be in the URL. The "slug" is completely ignored and just there for SEO/humans. If you send a link I instantly know what it's for -- that's pretty useful! I also like that the "id" which is an ASIN (Amazon Standard Identification Number) which is a superset of all ISBNs. This means you can just enter any book ISBN directly into t…
Examples of Great URL Design (2023)
71–80 of 163 posts
Re: Examples of Great URL Design (2023)
#72Re: Examples of Great URL Design (2023)
#73An example of a not-so-great URL design: Amazon product links have an optional slug before everything else like `{slug}/dp/{id}`. So you end up copying a gigantic URL everytime you wish to share a product unless you use the share product button to get the shortened link.
Lol this is almost the exact same thing as the very first example of good URI design in the article
Re: Examples of Great URL Design (2023)
#74I don't think will be relevant going forward, Safari already hides the URL beyond the domain name by default, and I presume other browsers do/will too.
Re: Examples of Great URL Design (2023)
#75Re: Examples of Great URL Design (2023)
#76We take the typical blog url design (/2024/08/14/slug) for granted but back in the very early 2000s pretty much every blog tool had its own URL design. Matthew Thomas back then took an inventory: https://web.archive.org/web/20030810201315/http://mpt.phrase... He was on the search for his ultimate blogging system, where this "cruft-free" URL structure should be used: https://web.archive.org/web/20051107103030/http://m…
He calls file extensions cruft, but i've come to value them. They are a simple way to indicate file type - desired or offered - which is easily understood by machines and people. I currently work with an API which does a bit of content negotiation using the Accept header, so clients can request data in various formats - application/json for a snapshot, text/event-stream for an updating feed, or text/html for an inter…
E. g. `/books` - looks at the `Accept` header. `/books.json` - sets the `Accept` header to `application/json`. `/books.xml` - `application/xml`, and so on.
Re: Examples of Great URL Design (2023)
#77https://github.com/torvalds/linux/commit/{hash}
Re: Examples of Great URL Design (2023)
#78The idea was really cool, but from talking to people at HP at the time, the implementation was apparently a complete nightmare done with an insane number of rewrites. It was sort of a hit and miss if the thing you typed in after /go/ would actually take you to the correct location, if any.
Re: Examples of Great URL Design (2023)
#79I can't check this because I'm on mobile, but I presume Stack Overflow uses a canonical tag in the HTML to state their preference that the longer version with the slug should be the default, because that's the one search engines use.
https://stackoverflow.com/questions/16245767
Responds with a 301 and a location header value of `/questions/16245767/creating-a-blob-from-a-base64-string-in-javascript`
Re: Examples of Great URL Design (2023)
#80One big question in URL design is this: Do path parameters get to have / in their values? Let’s say you have a link shortener service and want to allow users to define shortcuts like /mypath/:rest where rest is appended to example.com/ Now you’re in a very interesting position when it comes to resolving URLs. Curious to hear folks with experience in this
As per RFC 3986 [1], reserved characters such as , and / must be URL encoded. , is encoded as %2C / is encoded as %2F [1] https://www.rfc-editor.org/rfc/rfc3986