The URL Rewrite module does not directly support lighttpd, but can be made to work by manually putting rewrite rules in place.
touch /srv/www/localhost/gallery2/.htaccess chmod 666 /srv/www/localhost/gallery2/.htaccess
server.modules = (
"mod_rewrite",
"mod_access",
"mod_fastcgi",
"mod_ssi",
"mod_usertrack",
"mod_accesslog" )
Your Lighty will load that module. Now you have to add the url.rewrite rules to your configuration file. Lighty will parse the requested url and go transparently to the destination defined after the '=>'. Add these lines to your /etc/lighttpd/lighttpd.conf file:
url.rewrite = ( "^/(.*)/Rewrite.txt$" => "/$1/Works.txt", "^/gallery2/v/(\?.+|\ .)?$" => "/gallery2/main.php?g2_view=core.ShowItem", "^/gallery2/admin[/?]*(.*)$" => "/gallery2/main.php?g2_view=core.SiteAdmin&$1", "^/gallery2/d/([0-9]+)-([0-9]+)/([^\/]+)(\?|\ )?(.*)$" => "/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=$1&g2_serialNumber=$2&$3", "^/gallery2/v/([^?]+)/slideshow.html" => "/gallery2/main.php?g2_view=slideshow.Slideshow&g2_path=$1", "^/gallery2/v/([^?]+)(\?|\ )?(.*)$" => "/gallery2/main.php?g2_view=core.ShowItem&g2_path=$1&$3", "^/gallery2/c/add/([0-9]+).html" => "/gallery2/main.php?g2_view=comment.AddComment&g2_itemId=$1", "^/gallery2/c/view/([0-9]+).html" => "/gallery2/main.php?g2_view=comment.ShowAllComments&g2_itemId=$1", "^/gallery2/p/(.+)" => "/gallery2/main.php?g2_controller=permalinks.Redirect&g2_filename=$1", "^/key/([^?]+)(\?|\ )?(.*)$" => "/main.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=$1&$3" )
If needed, change gallery2 to your gallery2 path. The above rules are for the default patterns in the URL Rewrite module (the /v/, /d/, etc parts above). Any changes to these in URL Rewrite Site Admin will require matching changes to these rules.
Stop Lighty, and start it again from a commandline to see if you have made any typo. If it gives no error, it should be working.