Monday November 13, 2006

mod_rewrite Happiness

Software

Once in a while you write some code or a regular expression that makes you proud. Today has been one of those days. I'll admit that what I wrote isn't really special to advanced programmers, but five-minute one-liners that do the equivalent of what an intern could do in a hundred lines after a week make me smile:

RewriteRule ^/users/([^/]+)(/|/([^/]+)(/|/([^/]+)(/)?)?)?$ /users/index.php [L,E=profileId:$1,E=sectionId:$3,E=pageId:$5]

If you understand this, cool - definitely going to beat the average MySpace URL don't you think?

If you don't understand, no worries. You will at least understand why I answer mates and family with "computer stuff" when explaining my job.


© Copyright 1995-2007 Robert John Kaper. All rights reserved.

Powered by the delicious Kiki CMS! (#8/9)