On Wed, Jul 18, 2007 at 07:10:27PM -0000, John-Scott wrote: > Next, change your urls.py like so: > > (r'^characters/(?P<id>\d+)[-\w]+/$', object_detail, > dict(character_detail_dict)), > > This should capture the '123' and discard '-bob-and-jane'. This is a > fairly elegant solution that allows you to still have 'pretty' urls > that are human readable and google friendly while completely > sidestepping the complications of record retrieval based on reverse > engineering slugs or bothering with a slug column, opting instead for > the dead-simple and fast id lookup.
Don't we all agree that unique URLs with one-to-one relationships with unique resources are a Good Thing? I sure thought we did... Multiple URLs corresponding to the same resource will actually dilute your Google rank, anyway (if someone out in space uses the non-canonical version in a link). You could do a permanent redirect to the canonical version, I guess. -Forest
signature.asc
Description: Digital signature