Design Your URLs
URLs are the most important, and yet often least designed, part of your website. No matter if it’s a cool 2.0 application or plain vanilla homepage, it’s the URLs that lead the visitors to it. Why is it that almost nobody seem to know (or care about) how to design them?
Any web developer should know that URIs are a part of the sites user interface. Usability guru Jakob Nielsen reminded us about this back in 1999, but very few of us seem to remember.
Learning from bad examples
Here’s a typical example of a very bad URL:
This is so ugly that it’s impossible to say anything good about it. It makes me want to cry.
Apple usually gets things like these right. Apple.com is generally very good regarding to URLs, but then there is the Apple Store. I’ll buy you a beer if you can read this to your grandma over the phone:
Do you know where it points to? Of course not. But guess what’s the best part of it? It doesn’t work. Try it yourself.
As an example of a half-way designed URL, lets look at
This is a good example of an URL as UI. You may not want to visit that page after seeing the URL. But this is not a good URL. First, why on earth is there an
/index.php/ in the middle, even though it most definitely could have been omitted?
Also, the word ‘shop’ occurs twice in the URL. And ‘product’ is not useful here in any way, so why display it? Instead there could be some category reference in the URL so that products in different categories would be distinguishable.
With these tweaks a good URL for this product could be something like:
How to design good URLs
There are many preferences of how to build a good URL structure. The most important thing is to be consistent. The small details are not as important as that they are consistent as a whole.
Often the URL structure of a companys web site is similar to the inner structure of the company. This is a very basic mistake that you should avoid. While it may be quite easy for you to understand the inners of your company, it’s not something that your customer knows, or even should know. Try to be as descriptive and simple as you can when designing the URLs.
A good URL:
- is short
- gives user a hint about the content (ie. use
- tells user where he/she is (ie.
- is hackable (ie. if faq is at
/support/product_name/shows the support main page for this product and
/support/is the main support page. Also, if you search faq for product2, you should find it at
- does not have any session data or other cruft in it
- does not expose the underlying technology (like
How to redesign URLs
While Cool URIs don’t change, it’s inevitable that sometimes you have to change something. As a matter a fact, in my opinion, you should change the URLs as your organization changes. But when you do, you should do it very wisely.
Here are some tips:
- Avoid linkrot with any means necessary. With every changed URL, redirect the old URL permanently (using HTTP status code 301) to the new one. Automate the process if you can.
- Just in case, use a good 404 page that informs users about recent site redesigns, so that in case of a missed redirect, they can locate the moved page easily.
- Design to future. Try to avoid situations where you have to change URL designs more often than yearly.
- Use temporary redirects. For example, when designing a campaign site for spring 2007, you can use
/spring_campaign/or similar as the URL for marketing, and redirect the page temporarily (with HTTP status code 302) to
/spring_campaign/2007/. Next year, just change the redirect to
/spring_campaign/2008/. This way, when someone links to the campaign page, they’ll probaply link to the right permanent URL and you can still use short and easy to remember URLs in marketing.
- If, for whatever reason, you absolutely must delete a page, inform users about it on the 404 page. If possible, offer them a way to go to some other relevant page.
Require good URLs
Good URLs don’t just happen – you have to actively design and require them. Next time when listening to someone pitch about website design, publishing platform or developing framework, ask the person “what about the URLs”. Remember that the question is very much like “is she pregnant”, because it’s not possible to have a little bit customized URLs (well, it is, but it’s pointless) no more than it’s possible to be a little bit pregnant.
In web design, you can cut the corners in many places, but don’t do it with URLs.