Shami's Blog

Sysadmin, Because Even Developers Need Heroes

Lighttpd, Joomla, And Clean URLs

2009-06-22

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

About Me

Dev gone Ops gone DevOps. Any views expressed on this blog are mine alone and do not necessarily reflect the views of my employer.

twitter linkedin