That's pretty cool :) I got even lazier last week when I redesigned lazycat.org, again with mod_rewrite magic. The idea was to never have to change content files to update includes or other non-content things:
So basically all URLs instead get sent to view.php (which reads the URL, maps it to some layout-less html/php fragment in another directory - or to a 404 page - and displays it in the layout), and you can override by making an actual file. Cheap-ass pseudo-CMS. :) Actually I'm pretty sure the last two RewriteConds are superfluous, but I don't dare touch it now that it works!
no subject
Date: 2006-08-04 09:09 am (UTC)I got even lazier last week when I redesigned lazycat.org, again with mod_rewrite magic. The idea was to never have to change content files to update includes or other non-content things:
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) view.php [QSA,L]
So basically all URLs instead get sent to view.php (which reads the URL, maps it to some layout-less html/php fragment in another directory - or to a 404 page - and displays it in the layout), and you can override by making an actual file. Cheap-ass pseudo-CMS. :)
Actually I'm pretty sure the last two RewriteConds are superfluous, but I don't dare touch it now that it works!