Quick Apache Rewrite Rule for MVC Apps
Josh Schachter, at the Future of Web Apps Summit, described mod_rewrite as both a necessity and a “dark art.” For today’s crop of MVC-framework web applications, it’s difficult to create user-friendly and hackable URLs without it. Here are a couple rules that make it easy to direct all requests to a single controller:
RewriteEngine On RewriteBase / RewriteRule ^(.*).html$ index.php?request=$1 [QSA,L]
This will essentially push all files with an .html extension through your front controller. But, what if you have a file with this extension that you want to serve up? Just check to see if the file exists before redirecting to the controller:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*).html$ index.php?request=$1 [QSA,L]
This essentially replaces the O’Reilly tutorial about creating a front controller, and it even works in Apache 2!

Tyrant is a "meta" Rails application designed to run other Rails applications.
Recent Comments
Interesting.
I’ve been (mis)using similar behaviour in javascript for years.
var i = 0, car;
while( car = cars[i++]){
// do stuff
}
I suppose that the reason it works is exactly the same reason it works in Ruby ... but in this case I think the code is actually very easy to read.