Hacker News new | ask | show | jobs
by discreditable 2986 days ago
I used Amazon an an example because they are the first I learned to do this trick with. I know Amazon has canonical ways to shorten URLs. Many other sites don't. Here's Monoprice:

https://www.monoprice.com/product?c_id=102&cp_id=10260&cs_id...

p_id is all that matters:

https://www.monoprice.com/product?p_id=29523

95 chars to 45 chars.

CDW is more fun. They expect some pretty part of the URL, but don't do anything with it. So you shorten it to 1 char if you want the link to still work:

https://www.cdw.com/product/Tripp-Lite-10ft-Cat6-Gigabit-Sna...

becomes:

https://www.cdw.com/product/T/934322

127 chars to 37.