top | item 41244590

(no title)

wizerno | 1 year ago

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.

discuss

order

xyzzy_plugh|1 year ago

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.

pests|1 year ago

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.

fsckboy|1 year ago

>>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)

wizerno|1 year ago

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.

robin_reala|1 year ago

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

yoavm|1 year ago

The point is that the id comes last.

ryukoposting|1 year ago

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.

chamomeal|1 year ago

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

wizerno|1 year ago

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.

crazygringo|1 year ago

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.

layer8|1 year ago

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.

JohnFen|1 year ago

> 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.

fsckboy|1 year ago

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