Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

How should a good URI be designed? What are the factors to consider? What are the pros and cons of the variants?

Factors that makes up a good URI

  • Stability over time
  • Short
  • Give the user an idea what is linked
  • Easy to type
  • Easy to guess (relevant only for a few links like "/jobs")
  • Search engine friendly
  • URI schema should be consistent over the whole site
  • URI schema should allow future extensions

Any more?

Examples

  • example.com/articles/3252
  • example.com/articles/how+to+design+good+uri
  • example.com/articles/3252/how+to+design+good+uri
  • example.com/good-uri-design
  • example.com/articles/good-uri-design
  • example.com/a/good-uri-design
share|improve this question
    
Polls like this should always be a Community Wiki. Furthermore, the presentation of the question is overly leading IMO. –  Kris Aug 11 '10 at 9:17
    
You're right the arguments were leading. I've removed them. I changed it to community wiki. –  deamon Aug 11 '10 at 9:30
4  
I don't like the idea of turning PW into a poll site. The question itself has some merit but to just turn it into a popularity content is stupid. –  DisgruntledGoat Aug 11 '10 at 10:07
1  
I agree in that the question is not a candidate for a simple voting. –  deamon Aug 11 '10 at 10:21
    
Can you re-phrase this question to encourage answers that have some sort of technical merit? Right now, it is similar to asking "Do you like blue, green or some other color?" Flag this for moderator attention if you do, and we can re-open it. –  Tim Post Aug 12 '10 at 14:46
show 2 more comments

4 Answers

The real answer is to use whatever suits your site best. Some facts:

  • Keywords in the URL aid SEO and give users an idea of what the page is about. This is true for both static and dynamic URLs.
  • The consensus is that a lowercase slug, separated by dashes, is the best.
  • Search engines index dynamic URIs (e.g. index.php?page=about) just fine.
  • Using ID numbers in URLs is much easier/faster for grabbing the content from the database.
  • Search Engines prefer unique URLs, so it's best to avoid having parts of the URL with no bearing on what is displayed if possible.
  • Use rel="canonical" if you can't avoid possible duplicates. example.com/1234/my-page in theory should be different to example.com/1234/my-pgae but for most practical purposes they end up returning the same content, like on this site.
share|improve this answer
3  
All great tips, but the SEO benefit of keywords in the URL is largely a myth - googlewebmastercentral.blogspot.com/2008/09/… –  Gabe Aug 11 '10 at 21:52
1  
@Gabe: That page is completely irrelevant to the discussion and your point. If you have keywords in the URL, whether it is dynamic or static, it will aid SEO. That page does nothing to dispel that fact, it is simply saying if you already have dynamic URLs, there is no need to change to static (doing so could cause harm). –  DisgruntledGoat Aug 12 '10 at 12:42
add comment

Neither:

http://example.com/good-uri-design

or at least:

http://example.com/articles/good-uri-design

Good slugs are not necessarily the same as the title, they should be concise and use URL friendly characters.

share|improve this answer
    
Thank you for pointing out that the slug must not be the document title. It is so common (see this site) that I used it without thinking about it. –  deamon Aug 13 '10 at 6:28
add comment

This advice, from Jakob Neilsen, was written back in 1999 but still seems pertinent today:

The URL will continue to be part of the Web user interface for several more years, so a usable site requires:

  • a domain name that is easy to remember and easy to spell
  • short URLs
  • easy-to-type URLs
  • URLs that visualize the site structure
  • URLs that are "hackable" to allow users to move to higher levels of the information architecture by hacking off the end of the URL
  • persistent URLs that don't change

From: URL as UI

share|improve this answer
    
Nielsen advocates hierarchies in URIs, but they are problematic, because it is very likely that they change over time. And hierarchies are unidimensional, what makes the structure somewhat inflexible. But I agree with the other points. –  deamon Aug 14 '10 at 14:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.