lighttpd rewrite rules

For those who search for the rewrite rules with lighttpd:

Activate server module mod_rewrite

server.modules = ( "mod_rewrite" ...

Set the error-handler to index.php

server.error-handler-404 = "/index.php"

Then rewrite

url.rewrite = ( "^/([^.?])$" => "/index.php?route=$1" )

Posted September 16th, 2007 at 4:32am by delooks

Sorry there was something wrong with this configuration. The static files didn't load.

Finaly i got this working configuration.

replace url.rewrite with:


url.rewrite-final = (
"^/(scripts|styles|images)/(.*)$" => "/$1/$2",
"^/(.*)$" => "/index.php?__route__=$1"
)

the scripts|styles|images are your static files folders.

Posted September 16th, 2007 at 5:13am by delooks

Login or Register to Post