Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 the browser and end up on the right page (at least historically) instead of having to search for it.


This got a major retailor (Walmart maybe?) into issues awhile back as they were pulling the product title (only) from this param so people were having a heyday "renaming" official products on the official site.


>>Amazon product links have an optional slug BEFORE everything else

>I think this is actually a really great design in that the name of the product can always be in the URL

he said "before". you could accomplish your goal putting the slug "after". he's making the point that having a place after which you can harmlessly delete the rest of the url is better than having embedded NOPs surrounded by identifying information (not that the average user will ever edit any url, but there is still merit in what he said that you missed, and he's not disagreeing with you)


While the slug helps someone know what they're opening before reading it, most apps have link previews which give you just enough information you need.


I dont know if I'm in the minority but I really dislike link previews the vast majority of the time. They take up too much space and offer to little value. In discord I often x out of the preview and I know lots of others who do too.

Maybe on some sites it's fine but I feel like link previews need more modularity on size or something. Perbaps even configurable both host and client


You're not in the minority.

The information density of the preview has to match, if not exceed, that of the context in which it is provided. Most of the times it's a placeholder image with less text than the URL itself.


I just delete everything after the product ID manually. There are probably easier methods.


The point is that the id comes last.


Which makes sense because URLs are often displayed such that only a prefix is visible. And for editing, it’s still easy to cut and paste the ID.


At least that stuff is actually informative to a human. A lot of Amazon's URL bloat is the analytics crap they shove into query string. I started using ClearURLs specifically because of Amazon.


Lol this is almost the exact same thing as the very first example of good URI design in the article


If you're referring to the StackOverflow example from the article, it's different because they follow `/questions/:id/:slug`. Keeping slug at the end makes it a lot easier to delete while keeping it readable.


It is a curious decision why they chose to put the ID before the slug.

Stack Overflow, in contrast, puts the ID first, followed by an often very long slug. Which seems to be the more common pattern generally, as far as I can tell.

I do wonder what their rationale was/is.


It’s not that difficult to shorten it to the minimal “/dp/:id”. I always take care to do that when sharing an Amazon link.


> So you end up copying a gigantic URL everytime you wish to share a product

Yeah, when I used Amazon I found this incredibly annoying. When I wanted to share a link, I'd have to spend a few minutes figuring out how much of that stuff I could remove and testing the resulting URL before sharing it. A relatively minor irritation, but an irritation nonetheless.


having, like you, studied amazon urls, I just automatically delete everything?inclusive after the "?", then I edit the slug to make it contain a message personalized for my recipient




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: