» Technical »  Pretty URLs
Updated: August 16th, 2009
Each page of your website is associated with unique uniform resource locator (URL), a dedicated path that search engines, bookmarks and sharing networks use to identify pages of your website. These links are crucial for bringing all your visitors to see your content and although the users may not understand URLs or the technology behind them, there are some tweaks we can apply to make them more effective.
Use readable URLs
Word of mouth is the most effective form of Web advertising, with instant messaging and social networks being the favourite mediums for this. Some blogs and social networks can be completely link-specific, highlighting interesting articles on the Web in the hope to gain dedicated followers themselves. Sometimes links can be posted here out of context and a user may not be sure of what to expect on the target website.
The internet is full of spam, hoaxes and viruses, so users are understandably wary when they find an unlabelled link in their inbox or visit browsing the Web. A good portion of users will look at the URL address before they click it, to see if they recognise the target domain or to gain some insight into what the target article really is. When the user reads one of your URLs, you want them to feel safe in clicking the link.
Describe your content through readable URLs
For blogs and other content management systems, the best way to do this is to include the article title in the URL, rather than use a meaningless identifier. Consider the following two links:
http://usability.codegraffiti.com/?page_id=15
http://usability.codegraffiti.com/technical/pretty-urls
The second link is more readable and describes the purpose of the website, the target domain, the specific section of the website and the title of the article itself. The user can now make an educated decision on whether to trust your website and theres is a greater chance they’ll take the visit and come read your article.
Unfortunately this trick requires some work with the server configuration and may not be available to those using cheap shared hosting. WordPress has support built in or sites running on Apache servers can use mod_rewrite.
When linking in webpages, it is common to hide links behind text like this, but a user may still check where the target location is ahead of time (normally by looking at the status bar while hovering over the link). Emails are key area where this technique is successful, as the sender is unable to hide links behind descriptive text and users are increasingly wary of spam and hoaxes.
Make every page bookmarkable
Having users on your site is only half of the trouble, you want them to return as well. Statisticians often quote the unique views per month when saying how great their website it, but the users that keep coming back for more content are the truly valuable visitors.
You can help this process by making sure every different page on your website can be bookmarked; each page has a unique URL that can be saved, copied and shared. These page URLs are necessary for both the personal bookmarking process as well as enabling users to share links to pages with their friends; so it is definitely worth the effort!
The user should be able to bookmark every possible page combination.
For simple webpages you probably have done this already, but common areas of fault are with search results and filters on shopping websites, where the search parameters may be hidden and lost when the site is bookmarked. You should try to put all of these parameters in the URL itself, rather than hiding them in sessions or form values.
Avoid using frames, as these hide the URL from the user and all bookmarks they make will end up linking to the homepage. AJAX is good for functionality but may have the same problem unless you code with it correctly; see Gmail for a good example of how to do it right.
Simplify the URL
Somewhat contradicting with the objective above, you should try and minimize the information stored in the URL, so that it is as short as possible. Bookmarks won’t mind how long your links are, but shorter links are less error-prone when being copied by a user and won’t spam emails and instant messaging quite so much.
Shortening parameter and article names solves this problem whilst contradicting with our first point on this page, to make links readable. If in doubt, favour the above two goals first and only simplify the URL where it is possible.