

Pragmatism in URL design - vog
http://www.frankieroberto.com/weblog/1621

======
fnid2
Let the "name" in the url be irrelevant. Build your links so that there is a
unique identifier in the url that takes you to the page you want that will
never change. Then the name can change frequently without breaking links.

So if you have an album like this:
<http://albumsite.com/albums/1/This_Great_Album> and the name changes to This
great cd, then the url becomes <http://albumsite.com/albums/1/This_Great_cd>
and both links continue to work forever. Where the unique identifier in this
case is 1.

Of course that makes users have to know what the unique ID is, but you can put
the permalink on the page.

~~~
smackfu
An example in the wild:

[http://ask.metafilter.com/147349/Government-funding-for-a-
ne...](http://ask.metafilter.com/147349/Government-funding-for-a-new-UK-
limited-company)

Everything after the number is just for humans.

~~~
fnid2
In practice, I use a slight enhancement. Not only does the url contain the ID
to the element, but changing a part of it can tell the site how to _display_
the data.

For example:
[http://www.shellcompanyfinder.com/ShellCompanies/7845/11/Nat...](http://www.shellcompanyfinder.com/ShellCompanies/7845/11/NathanMyhrvoldsIntellectualVentures)
Is a url that shows the data for a human.

[http://www.shellcompanyfinder.com/ShellCompanies/7845/35/Nat...](http://www.shellcompanyfinder.com/ShellCompanies/7845/35/NathanMyhrvoldsIntellectualVentures)
or
[http://www.shellcompanyfinder.com/ShellCompanies/7845/json/N...](http://www.shellcompanyfinder.com/ShellCompanies/7845/json/NathanMyhrvoldsIntellectualVentures)

Will show the data in JSON format. Or you can get it in CSV if you prefer:
[http://www.shellcompanyfinder.com/ShellCompanies/7845/csv/Na...](http://www.shellcompanyfinder.com/ShellCompanies/7845/csv/NathanMyhrvoldsIntellectualVentures)

Makes it easy to show human forms and also keep it accessible to automation
and integration in an easy and consistent manner.

~~~
semanticist
Why not use .json/.csv instead of embedding it midway through the URL?

------
brc
If you're at all interested in getting users to click on links to your site,
then you need to make the url relevant. All the discussion of unique ids and
other parts is for technical types who want to split definitions. If you are
after traffic, whether, search, referral or text advertising (adwords) then
you'll want a short, concise Url that closely matches what the searcher wants.
Click through rates for adwords where the url matches the search term can be
twice as high as when they don't match.

Rightly or wrongly, the average internet user equates the Url as a strong
indicator of the content on a page. Google follows what people do, so they
weight it highly as well.

Want traffic? Short human readable Urls you need.

