Running CakePHP on lighttpd is a bit of a problem since lighttpd doesn’t support the htaccess files and thus the neat-URL rewrites breaks.
I found a way to get this working from Guy Rutenberg’s site. First open up /etc/lighttpd/lighttpd.conf in you fav editor (if you are using an SSH client, just use Vi).
And at the end of the file lighttpd.conf insert this lines…
include "cakephp_neat_urls.conf"
This line ensures that incase you want to make some changes to these urls in the future, you won’t have to mess with the lighttpd’s main config file. So noe create a new file called cakephp_neat_urls.conf in the /etc/lighttpd dir and dump the following lines in the new file after changing a few things (that are italised).
$HTTP["host"] =~ "^(www\.)?domain.com" {
server.document-root = "/path-to-your-webroot/"
url.rewrite = (
"(css|files|img|js)/(.*)" => "/$1/$2",
"^([^\?]*)(\?(.+))?$" => "/index.php?url=$1&$3",
)
}
