Shami's Blog

Sysadmin, Because Even Developers Need Heroes

Lighttpd, Joomla, And Clean URLs

2009-06-22 by Mohammad H. Al-Shami

So I’m working on a new web server but I don’t want to use Apache since it’s a virtual machine. Had some trouble with the rewirte rules but I think I got them

From this forum post

$HTTP["url"] !~ ".(gif|png|css|jpg|jpeg|js)$" {
   server.error-handler-404 = "/index.php"

But I thought of a different approach and it seems to work so far, and maybe causes less error messages in the logs:

url.rewrite-once = ("^/(.*.html)$" => "/index.php?page=$1", "^/(.*.html?.*)" => "/index.php?page=$1", "^/(.*/?.*)" => "/index.php?page=$1")

Have a good one