Page:Aaron Swartz s A Programmable Web An Unfinished Work.pdf/28

16 '''2. BUILDING FOR USERS: DESIGNING URLS''' (The URLs for links aren’t as smart, but let’s not dwell on that.) It’s hard to give general rules for how to solve such inter-linking problems; you basically have to do what “feels right” for your app. for social sites, like Delicious and Twitter, this means putting the focus on the users, since that’s primarily what users care about. But for other apps that might make less sense.

It’s tempting to just not decide and support all of them. So, in place of Delicious, you’d have:

http://del.example.org/u/aaronsw (links from me) http://del.example.org/t/tech (links about tech) http://del.example.org/u/aaronsw/t:tech (links from about tech) http://del.example.org/t/tech/u:aaronsw (links about tech from me)

The problem here is that the last two are duplicates. You really want to pick one form and stay with it, otherwise you end up confusing search engines and browser histories and all the other tools that try to keep track of whether they’ve already visited a page or not. If you do have multiple ways of getting to the same page, you should pick one as the ofﬁcial one and make sure all the others redirect. (In an extreme case, you’d take the “video+tech” example above and redirect it to “tech+video”, making the ofﬁcial URL be the one where the tags are in alphabetical order.)

Next up: site pages. Looking at Twitter and Delicious basically give away the store above (you mean I can have “twitter.com/contact” if my username is “contact”?!), you might wonder where they can possibly put their help and login pages. One trick might be to reserve a subdirectory like ‘/meta/‘ and put everything in there. But Delicious and Twitter seem to get by just by reserving all the important potential-page-names and putting stuff there. So, as you’d expect, Twitter’s login page is at:

http://twitter.com/login

And, if you’re not expecting to have a lot of site pages, this will get you thru. (Be sure to reserve “help” and “about”, though.)

And, of course, if you’re not giving away the store, you don’t have any of these problems. So just pick the sensible URLs for the pages that users come to expect. And, of course, be sure to follow all the noun-principles above.