Enabling CakePHP 1.1 on Lighttpd 1.5

Somebody wrote an excellent post on how to make CakePHP work on LigHTTPD. It didn't work for me right away because for some reason mod_rewrite or my CakePHP settings are different from the "default" behavior.

Most blogs say that their URL arguments for non-tidy URLs are like this: /cakedir/index.php?url=pagename. However, for some reason my URLs are like this: /cakedir/index.php/pagename. I'm not sure why that is.

Nevertheless, you can follow the instructions in the blog post but if you have the same URL path rewrite setup as I do you will need to make a critical change to the url.rewrite-once statement:

#this is the original
   url.rewrite-once = (
    "^/(css|files|img|js|stats)/(.*)$" => "/$1/$2",
    "^/(.*)$" => "/index.php?url=$1"
   )

#change the index.php part
   url.rewrite-once = (
    "^/(css|files|img|js|stats)/(.*)$" => "/$1/$2",
    "^/(.*)$" => "/index.php/$1"
   )

Enabling CakePHP 1.1 on Lighttpd 1.5