Short URLs: why and how

If 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:

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.

Then, assuming the Nginx web server, add this line to my http block:

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.

Your thoughts?
Please leave a reply:


Comments

  1. Noah (2022-05-08)

    I've always liked your short URLs. Nice to see the reason why they are so!

  2. Paul Butzi (2022-05-08)

    Hmm. My first thought here is that I agree with the idea of optimizing the utility of URLs but I don&#39;t see shortness as the highest utility. <br> <br>Suppose I want to share my hypothetical &#39;first follower&#39; post with the world. In the moment, I think &quot;Now, what was the URL for that article I wrote long ago? Was it &#39;ff&#39;? Or was that the article about foot fungus, or maybe the one about fast forward, or perhaps the one about forestry fundamentals?&quot; <br> <br>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? <br> <br>I like brevity and concision. I also like saying things in a way that&#39;s clear and which people can remember. <br> <br>So, to evaluate: what will the people listening to my presentation do with the time they saved by avoiding typing &#39;VIS&#39; and &#39;ntennas&#39;? Is that worth the reduction in memorability and clarity I get when I go from &#39;NVISantennas&#39; to &#39;na&#39;? <br> <br>Note that I am not advocating for URL&#39;s like &quot;what-is-an-nvis-antenna-and-why-you-might-want-one?&quot; <br> <br>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&#39;t choose between &#39;nvisantennas&#39; and &#39;na&#39;, I can have both although that substantially increases the administrative costs as I have to make sure I never generate collisions for either name.

  3. Olivian Breda (2022-05-08)

    I admired and recommended your way of choosing URLs for years. <br> <br>Still, on my own website I tend to use one or two words, separated by hyphens. <br> <br>The thing is, if I receive a URL lie /su I will not understand what is the URL about, but /short-urls is clear &amp; still, rather simple.

  4. Dharmesh Shah (2022-05-09)

    +1 with you on beautiful, elegant, short URLs. <br> <br>Another thing I&#39;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).

  5. Vigilante (2022-05-09)

    Short URLs are good for small blog. <br>But you won&#39;t do this if you have something like reelgood or imdb or other website with thousands if not millions of entities.

  6. Santosh (2022-05-09)

    Totally agree. I use a link shortener like this l.mypad.in/y_su <br> <br>l =&gt; Link (subdomain) <br>mypad.in =&gt; Domain <br>URL =&gt; simple one <br> <br> <br>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.

  7. spike (2022-05-09)

    yeah that&#39;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)

  8. Nico (2022-05-09)

    I still add .html because sometimes it&#39;s useful to drop a copy of a site on disk.

  9. Paul (2022-05-09)

    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. <br> <br>You can just type in o/sivers in your URL bar and you&#39;ll reach the homepage of Derek Sivers. <br>P.S: Add OSlash extension to your browser before you type in the shortcut (www.oslash.com/get-started)

  10. mlkrsrc (2022-05-09)

    Great insight, long live PG

  11. Richard (2022-05-12)

    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&#39;s so refreshing. Seeing your URLs just think makes me think &quot;that is so Derek Sivers&quot; - which is wonderful! <br> <br>Keep up the great work <br><span class="response">☺ What a nice compliment! Thank you. — Derek</span>

  12. Derek Sivers (2022-05-14)

    Also see this page, of very similar thoughts, but elaborated more: <br> <br>qntm.org/urls <br> <br>(Thanks to D. Bodhan for showing me this today.)

  13. visitor (2022-05-16)

    I agree with Richard, it does align quite nicely with the style and the overall message of your work. <br> <br>Side question since you mentioned NGINX, are you still using OpenBSD for everything? <br>If so, why not use its native (and modern) httpd instead of nginx? <br> <br>man.openbsd.org/httpd.8 <br><span class="response">Love OpenBSD and yes, using it for everything. But Nginx has features I like that httpd doesn't yet have. — Derek</span>

  14. Abedi Obasanjo (2022-05-21)

    This isn&#39;t about &quot;branding&quot; or &quot;authenticity&quot;. This is just the right thing to do. <br> <br>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. <br> <br>For my website, the only way to get the URL without the ugly &quot;.html&quot; at the end was to call the page an &quot;index&quot; file. <br> <br>So I&#39;ve got several directories that all contain an &quot;index&quot; file. Crazy? Yes. But the clean URLs are worth it.

  15. Leah Nielson (2022-06-20)

    Re: The Social Media Share button stuff. <br> <br>Yeah but most social medias automatically convert your links to a analytics link so that benefit is automatically nullified.

  16. Riddhesh (2022-06-26)

    Does anyone know what to do if you use GitHub pages?

  17. Vivek Wisdom (2022-07-21)

    I agree with keeping URL&#39;s short and concise. <br> <br>We also have to understand that these days lot of people find content using search engines and for them URL&#39;s are part of indexing mechanism. <br> <br>Keeping it short yet specific to post can be a good idea. Essentially we can remove all the stop words from URL. <br> <br>For Ex: <br> <br>Original =&gt; yoursite.com/blog/2022/05/08/short-urls-why-and-how.html <br>New =&gt; yoursite.com/short-urls <br> <br>or <br> <br>Original: site.com/polut <br>New: site.com/digital-polution <br> <br>Although, I am curious how do you decide what URL to keep? is there a script to automatically suggest that from a title etc. <br><span class="response">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</span>

  18. Mike (2022-08-03)

    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. <br><span class="response">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</span>

  19. Sam (2022-09-21)

    Love the philosophy of short URLS. The only barrier I&#39;ve found is communicating them verbally over the phone or in a podcast interview. <br> <br>To me &quot;Sivers dot org&quot; is easily remembered by the listener. Fully pronouncing &quot;S-I-V-E dot R-S&quot; feels like it invites errors on the listeners part (&quot;Wait, was it S-I-V dot E-R-S?&quot;) <br> <br>What approach do others take when verbalizing short urls or using uncommon TLDs?

  20. Ivan (2023-04-27)

    Could you precise how to edit the http block? <br>My web server is hosted on Vultr, just like you advised on your Tech Independence post. <br>Maybe that&#39;s something to add in that post? :)

  21. Ivan (2023-04-27)

    never mind my previous comment, I&#39;m gonna try with this : spinupwp.com/doc/changing-nginx-settings/

  22. dario (2023-05-03)

    Hello, <br>thanks for your blog. <br>I just listen to tim ferris podcast with you. <br>I am interested in all the tech part you explained in the podcast, could you post a summary on all the instruction you gave. For instance, how to prepared my own server, where to buy the domain and so for and so on. <br>Thank you very much. <br> <br>you are great.

  23. James (2023-05-21)

    Your approach to tech is a return to simple, durable and dependable. Nothing prematurely optimized or over-architected. It is a refreshing perspective, perfectly in inline with your writing approach. <br> <br>May you share how you&#39;ve built lists and summaries of posts on sive.rs/blog and sive.rs/en.atom Are there any scripting, parsing, database, or cache systems in play?

  24. Jake (2023-08-13)

    I&#39;m sold! Thanks for the persuasive points and for taking the time to make the Internet world a simpler place.

  25. Marc (2023-09-22)

    I love cryptome-vibe sites ;)

  26. JM Domingo (2024-02-06)

    I&#39;m having trouble implementing Derek&#39;s tip from the Tech Independence article about using short urls. I removed &quot;.html&quot; from my HTML filename and updated the link to that page from another page to not have the &quot;.html&quot; extension. But when I try to click the link to that new page on the site itself, I get a 404 error. <br> <br>Example: changed my about.html file name to just &quot;about&quot; then changed the link on my home page from: a href=&quot;About.html&quot; to a href=&quot;About&quot;. <br> <br>Any help? <br><span class="response">Make sure your /etc/httpd.conf file has the line <strong><code>default type text/html</code></strong> — Derek</span>