[Welcome] [TitleIndex] [WordIndex

Some web applications have very messy URLs. Here's an example of a bad URL:

Its flaws are:

  1. Uses a machine name instead of a functional alias such as 'www'.
  2. Shows the programming language and toolkit being used ('.jsp'). When you rewrite the site in Python, all the URLs will break.
  3. Includes a lengthy query string. Some variables in the query string are obvious (action, id), but others are obscure (what does 'tag' mean?).

Avoid making bad URLs such as this one. Quixote's _q_lookup() makes it easy to use components of the URL, so you can have URLs such as example.com/catalog/1234567/display . The benefits are:

  1. URLs are shorter, making them easier to cut-and-paste or remember.
  2. When there are additional pages for an object, it's easy to extend this scheme. You could have /catalog/1234567/edit, .../admin, .../inventory, and so forth.
  3. URLs in this style are more transparent and discoverable, not meaningless mysteries that reveal nothing. Users often first come to your site via a search engine that directs them to some deeply buried page, and will often try to manually edit the URL to discover more about your site.

Any more benefits?

  1. URLs in this style look like static pages, which search engines may favour over URLs with GET parameters.

References

Part 1 of the Quixote tutorial discusses the importance of URLs.

The W3C has a page on URL style titled Cool URIs Don't Change.

Jakob Neilsen has written about URL as User Interface.

The artist known as Waferbaby wrote Slash Forward, which touches on the virtues of the sort of URLs that Quixote makes so easy. There's a lot more wonderful stuff about web design in Zeldman's A List Apart magazine.


CategoryCookbook


2010-09-22 22:14