Best practices for formatting a URL with a numerical index
A lot of the time, using pure clean URLs are impossible due to certain limitations such as the possibility of the segment mapping to more than one resource. In this case, the URL must contain an ID (generally the ID in the database).
Whilst this certainly does not look as pretty, it doesn't mean you can't have a slug in the URL for readability and for SEO purposes.
Consider this URL: http://stackoverflow.com/questions/361635/debugging-javascript-in-ie7
The portion /debugging-javascript-in-ie7 should be entirely optional, because user generated content does change, and some URLs can be accidentally truncated as they are copy and pasted, for example. In the example above, the slug is optional.
The slug, being optional, should be added if the resource is requested without the slug. This will ensure the correct URL is copied / linked to and it will ensure you won't be penalised for duplicate content. This is trivial using either .htaccess (or equivalent) or in the server side code.
Comments
Alexander Dickson
Posted on Wednesday, 19th August 2009 @ 9:54am.WOOF
courtnee
Posted on Friday, 14th August 2009 @ 7:51pm.MEOW
Leave a Comment
Note: Your comment may require approval before it is posted to the site.