3 ms·
I would love some sort of standard for "short" URLs that are primarily designed for sharing. This would serve as an alternative to the current – usually hierarc
by adesanmi 4y ago
I would love some sort of standard for "short" URLs that are primarily designed for sharing. This would serve as an alternative to the current – usually hierarchial – URLs that are primarily designed around SEO.
- cryptos 4y agoThe bas thing with existing third-party URL shorteners is that they might (and do) go out of business at any time! I'm not sure whether we need a standard for it, but it might be a good idea to be indendent of such external services. A simple, generic way could be a hash of the original URL with a compact representation: http://example.com/some/path/to/stuff?filter1=asdf&filter2=90#positionX http://example.com/s/Wq_2 /s stands for "short" and the ID is the hash representation. If you use a-zA-Z0-9 plus some URL safe characters like _ it should be reasonably short even for large sites. The CMS or whatever software doesn't have to to implement something, because it is mostly just a generic URL shortener running on the same host.
- kevincox 4y agoIt would love to see something like a "short" link tag. For example imagine that YouTube provided the following tag on video pages <link rel=short href="https://youtu.be/abcdef"/> Then copying the URL could copy the short link instead. That being said I like when the URL is readable. The YouTube example works because everyone knows that YouTube is a video. Presumably for non-video links they could use something like /user/foobar to differentiate from their "main product". But for blog posts I would much rather see something like /short-urls rather than /su as the reader gets nothing from the first one.
- sysadm1n 4y agoYou could also specify the corresponding short URL of a page with a META tag: <meta property="shortlink" content="https://bit.ly/shortlink"> Just because it's not a standard doesn't mean you can't use it. This is sort of futureproofing incase it does become a standard.
- kevincox 4y agoI don't care if it is a "standard" but it would be nice if people agreed on something. Is the meta version being used anywhere? It looks what I described is very existing to the spec published here: https://microformats.org/wiki/rel-shortlink https://microformats.org/wiki/rel-shortlink
- sysadm1n 4y agoOnly learning about this now. Thanks for pointing it out. I remember seeing this in the source of some blogs, great to know the exact snippet of code I should be using.