Date: 2006-08-04 09:09 am (UTC)
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:

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!
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Profile

egypturnash: (Default)
Margaret Trauth

October 2020

S M T W T F S
    123
45678 910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Expand Cut Tags

No cut tags
Page generated Jul. 17th, 2025 12:59 am