Three ways to name the same piece
- An opaque ID
- A globally unique identifier, or GUID, can be assigned once and carried into another system. It gives little away about the subject, but editing the title need never disturb it.
- A date and a title
- A path such as /2003/08/bench-notes/ gives a reader context. Freeze the chosen date in the public path. Reinterpreting a midnight timestamp in a different time zone can otherwise move a post across a day boundary.
- A short slug
- In /entries/bench-notes/, the slug is the readable final part. Pick it when the entry is published and store it. Recomputing it on every edit ties a reader’s bookmark to the latest headline.
The old documentation linked comments by GUID and sections by category name in a query string. Those two addresses did different jobs. A category address could show a changing collection. The comment link needed to return to a particular entry.
Where an address points
A public path can stay fixed as the file or database row behind it moves. A router can look up the entry and serve it directly at the original path. If a public move is necessary, send the old address straight to the final one with a permanent redirect. A chain of intermediate moves adds another place for a visit to fail.
Tim Berners-Lee wrote, “A cool URI is one which does not change.” A canonical link identifies the preferred address in a document. A redirect handles the actual visit to the superseded address.
Rehearse a rename
- Title now
- Notes from the workbench
- Public path
- /entries/bench-notes/
- Entry ID
- bench-17
Try an old bookmark, an inbound link with a query and a URL copied from the feed. Check their final destinations and inspect the page heading. A server that sends every missing path to the home page can return a successful response while losing the article the reader came for.
