Cool URIs Don’t Change — But Humans Do

Here are two ideas at odds with each other:

  1. You should have human-friendly URIs
  2. Cool URIs don’t change

If a slug is going to be human-friendly, i.e. human-readable, then it's going to contain information that is subject to change because humans make errors.

If “to err is human” then our errors will be forever cemented into our URIs at publish time.

For example, if I write:


But later realize I was wrong, I can change the content at that URI but am forever stuck with the erroneous idea expressed in my slug (if my URI is to remain cool).

Whereas if I’d had a non-human-readable URI like this:


Then I can hide from my errors by merely updating the content at that URI anytime I want.

How do you get around this problem?

In my post about great URI designs I note how StackOverflow addresses this via a URI design that puts the machine-readable identifier first, then the human-readable slug second.


This allows the slug to change over time without breaking links. For example, you could publish:


And later change it to:


And both will resolve to the same resource. It doesn’t matter what you put in the position of :slug it’ll always be as if you merely typed:


Granted you can’t protect from people putting misleading information in your URIs. For example, this would resolve to the same resource as the others:


That said, there is one problem with the StackOverflow example: it doesn’t work with simple static file hosts where you don’t have control over routing logic.

The McGyver, jerry-rigged version of this URL would be to use a search param that doesn’t do anything other than provide human-readable context. For example:


That would work with a static file host without special routing logic (though it’s still subject to abuse same as the StackOverflow example).

So, to my original example:


Could later be changed to:


And it remains cool 🕶️

Not saying you should, but you could.