[prev] Tue, 16 Dec 2003 11:58:48 -0500 [next] [computing] - [comment]
I only just discovered Apache's mod_rewrite yesterday, but I've already implemented it. To keep it simple, mod_rewrite can do some pretty cool things, but I've made it do something very trivial:
Take an ugly URL like this:
And turn it into something much less offensive, like this:
The best part of this fairly elegant solution is that both links will still work. Here's the rule that does it:
RewriteRule ^view/(.*)/(.*).php /view.php?type=$1&id=$2

Now I will make sure to add this to my next website rewrite that's scheduled to be finished this Christmas break.
(Actually it was originally scheduled to be finished before the start of this semester, but er, software delay!)
That depends on your definition of cool, I guess. It's a neat little trick, and I'm surprised I never ran across it earlier.
I look forward to the new and improved http://www.javabsp.org!