Short URLs: why and how
2022-05-08If you make your own website, consider making short URLs.
This is not about a URL shortener. This is about making your original URLs short in the first place.
Instead of:
yoursite.com/blog/2022/05/08/short-urls-why-and-how.html
… consider just:
yoursite.com/short
Why?
Short URLs matter for a few reasons:
- I can remember my URLs. I can avoid the search engine step. (No need to search when I already know the answer.) Which means…
- I can type it or say it. Whether texting, answering an email, or talking to someone on the phone, I can say, “Go to sive.rs/ff for my talk about the first follower.” or “My newest book is at sive.rs/h.” I do this often, so having memorable URLs, easy to type in full, saves me a lot of searching.
- They look nicer. They’re aesthetic. They show care. We should put something of beauty into the world, instead of creating digital pollution.
- They remove the middle-man. With long URLs, people use those ugly social share buttons that promote (and further entrench) harmful social media sites, and add visual clutter to your site. Short URLs encourage people to copy and paste the URL directly, which lets them share it anywhere, instead of only the sites for which you have a share button.
-
They’re enough.
Using 36 characters (a-z and 0-9):
2-character URLs give me 1296 (36²) unique combinations.
3-character URLs give me 46,656 (36³) unique combinations.
4-character URLs give me 1,679,616 (36⁴) unique combinations.
I don’t need more than that.
That doesn’t mean the shorter the better.
If I can remember “/plaintext” easier than “/pt”, then that’s a better choice.
How?
Here’s how I do it:
Save my HTML file as the URL name, with no extension.
Instead of “hi.html”, I save it as “hi” in my public web root.
default_type text/html;That’s it! That serves my files without extensions as HTML.
If I ever switch to a different system or server, there is always a way to pull up your HTML using a short URL.
I've always liked your short URLs. Nice to see the reason why they are so!
Hmm. My first thought here is that I agree with the idea of optimizing the utility of URLs but I don't see shortness as the highest utility.
Suppose I want to share my hypothetical 'first follower' post with the world. In the moment, I think "Now, what was the URL for that article I wrote long ago? Was it 'ff'? Or was that the article about foot fungus, or maybe the one about fast forward, or perhaps the one about forestry fundamentals?"
If someone hears me speaking and wants to find my article on NVIS antennas, are they more likely to remember it when they get home if the URL is paulbutzi.com/na, or paulbutzi.com/NVISantennas?
I like brevity and concision. I also like saying things in a way that's clear and which people can remember.
So, to evaluate: what will the people listening to my presentation do with the time they saved by avoiding typing 'VIS' and 'ntennas'? Is that worth the reduction in memorability and clarity I get when I go from 'NVISantennas' to 'na'?
Note that I am not advocating for URL's like "what-is-an-nvis-antenna-and-why-you-might-want-one?"
Of course, the mapping from URLs to posts need not be bijective (one to one), it only needs to be surjective (every post must have at least one URL). So I needn't choose between 'nvisantennas' and 'na', I can have both although that substantially increases the administrative costs as I have to make sure I never generate collisions for either name.
I admired and recommended your way of choosing URLs for years.
Still, on my own website I tend to use one or two words, separated by hyphens.
The thing is, if I receive a URL lie /su I will not understand what is the URL about, but /short-urls is clear & still, rather simple.
+1 with you on beautiful, elegant, short URLs.
Another thing I've also used is creating a domain name that redirects to a particular article/page. Example: SorryMustPass.org (which is easy for me to refer to when I need it).
Short URLs are good for small blog.
But you won't do this if you have something like reelgood or imdb or other website with thousands if not millions of entities.
Totally agree. I use a link shortener like this https://l.mypad.in/y_su
l => Link (subdomain)
mypad.in => Domain
URL => simple one
I did this for myself actually so that I can quickly go to my fav apps .. but then now use it for all useful links. The service I use comes with neat search functionality to dig up old links.
yeah that's a nice to have but in reality not always achievable, plus SEO sometimes requires keywording urls (e.g. /domain/files/this-keyword-blah-blah.html)
I still add .html because sometimes it's useful to drop a copy of a site on disk.
I use OSlash. You can pretty much name your links anything you want. Saves a ton of time and easy to remember since you have entire control on naming the link.
You can just type in o/sivers in your URL bar and you'll reach the homepage of Derek Sivers.
P.S: Add OSlash extension to your browser before you type in the shortcut (https://www.oslash.com/get-started)
Great insight, long live PG
Your use of short URLs are particularly effective as they are so harmonious with your branding/message as a whole. The consistency with which you speak, write, and communicate here and on email all radiate utter authenticity. It's so refreshing. Seeing your URLs just think makes me think "that is so Derek Sivers" - which is wonderful!
Keep up the great work
☺ What a nice compliment! Thank you. — Derek
Also see this page, of very similar thoughts, but elaborated more:
https://qntm.org/urls
(Thanks to D. Bodhan for showing me this today.)
I agree with Richard, it does align quite nicely with the style and the overall message of your work.
Side question since you mentioned NGINX, are you still using OpenBSD for everything?
If so, why not use its native (and modern) httpd instead of nginx?
https://man.openbsd.org/httpd.8
Love OpenBSD and yes, using it for everything. But Nginx has features I like that httpd doesn't yet have. — Derek
This isn't about "branding" or "authenticity". This is just the right thing to do.
Short URLs benefit everyone, from the visitor to the webmaster. Wherever possible, they should be used. Even if they cause a bit of extra work for the web designer.
For my website, the only way to get the URL without the ugly ".html" at the end was to call the page an "index" file.
So I've got several directories that all contain an "index" file. Crazy? Yes. But the clean URLs are worth it.
Re: The Social Media Share button stuff.
Yeah but most social medias automatically convert your links to a analytics link so that benefit is automatically nullified.
Does anyone know what to do if you use GitHub pages?
I agree with keeping URL's short and concise.
We also have to understand that these days lot of people find content using search engines and for them URL's are part of indexing mechanism.
Keeping it short yet specific to post can be a good idea. Essentially we can remove all the stop words from URL.
For Ex:
Original => yoursite.com/blog/2022/05/08/short-urls-why-and-how.html
New => yoursite.com/short-urls
or
Original: site.com/polut
New: site.com/digital-polution
Although, I am curious how do you decide what URL to keep? is there a script to automatically suggest that from a title etc.
I don't care about SEO because it's always changing and I'm thinking very long-term. So I choose a URL that I can remember. I reference my own URLs often when answering emails, so that's what's most important to me. — Derek
Thank you for sharing this, Derek. I love this idea. I have a question. Do you add this line of code to each html file you save? Or where does your "http block" reside? Thank you for your help.
It’s in the config file — nginx.conf — on the server, so only edited once when you first set up your web server. I set it as that once over 14 years ago, and haven’t touched it since. — Derek
Love the philosophy of short URLS. The only barrier I've found is communicating them verbally over the phone or in a podcast interview.
To me "Sivers dot org" is easily remembered by the listener. Fully pronouncing "S-I-V-E dot R-S" feels like it invites errors on the listeners part ("Wait, was it S-I-V dot E-R-S?")
What approach do others take when verbalizing short urls or using uncommon TLDs?