Designing URLs

Trailing slashes

According to RFC 3986 the following two URLs are not necessarily equivalent:


But most users would think the two were equivalent. What's to be done? I think the RFC should have said that the first should be normalized to the second. However, working with the RFC as it is, we can issue a 301 (Moved Permanently) from to Purists might object that a 301 is for a resource that used to exist but has moved, and never did exist. I'm a purist but I don't think this use of 301 stretches its meaning too far.

Cool URIs don't change

Say we have to refer to organizations, we might have URLs like:


This is the approach favoured in If Sweb undergoes a rebranding and the new name is EDF can make send a permanet redirect to:

Some problems with this approach are:

  • If the URLs are maintained manually, it takes time / money for a diligent webmaster to remember to add the redirect.
  • If the URLs are for a web application, the web application software becomes more complicated, again costing time / money.
  • What if another company starts up with the name SWEB? (Unlikely with this example, but you can imagine it being a problem in other contexts).

These problems are solved with a scheme like:


This takes Cool URIs don't change to an extreme. The drawback is of course that URLs lose much of their meaning, but my view is that the tradeoff is worth it. Okay, so you've convinced my to use meaningless ids. What about using ISBN codes for books and license numbers for cars as my id?

Established ids in URLs?

The book 'Being And Nothingness' by Jean-Paul Sartre has ISBN 0671867806. If on my website I have reviews of books, should I use the ISBN?

No, because I may have got the isbn wrong, and then the URI would have to change. Better to have a completely new id:

But what if I have the ISBN and I want to find the corresponding review on It should be possible to do a query like:

This is the URL equivalent to the intelligent versus surrogate keys debate in SQL.