FatFree PHP Framework rewriting with Lighttpd
I’ve been working with PHP for several years now, but have never used any of the numerous frameworks out there. I’m a little late to the game, but I figured it was time I started being a little more productive. There is no need to write all of the boring stuff if there is already a framework that will do it for me.
I’ve decided that my first framework to toy with will be FatFree. Everything worked perfectly if I only had a default route, but trying to use additional routes always resulted in a FatFree generated 404 page. I’ve spent the last hour looking through the documentation (and searching the web) for the proper Lighttpd rewrite rule, but they were all exactly the same as what I already had. I decided to try the same trick with FatFree that I used for WordPress permalinks – setting the 404 error page to index.php.
$HTTP["host"] == "example.com" {
server.document-root = "/home/jason/www/example.com"
server.error-handler-404 = "/index.php"
}
Immediately, my routes were all working! I’m sure this will cause some sort of issue down the road but I am happy for now.




