Some web applications have very messy URLs. Here's an example of a bad URL:
Its flaws are:
- Uses a machine name instead of a functional alias such as 'www'.
- Shows the programming language and toolkit being used ('.jsp'). When you rewrite the site in Python, all the URLs will break.
- 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:
- URLs are shorter, making them easier to cut-and-paste or remember.
- 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.
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?
- URLs in this style look like static pages, which search engines may favour over URLs with GET parameters.
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.