Lighttpd mod_rewrite conversion from .htaccess format

Posted by hoball on Server Fault See other posts from Server Fault or by hoball
Published on 2010-05-26T08:44:51Z Indexed on 2010/05/26 8:51 UTC
Read the original article Hit count: 254

Filed under:
|
|
|

Hello, I am using lighttpd as webserver and is having an issue about mod_rewrite.

Currently I have a set of Apache .htaccess rewrite rules from a PHP script:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php [QSA,L]

In my understanding, if the requested URI is not a file/directory/sym-link, append it to index.php

eg. www.a.com/hello/world --> www.a.com/index.php/hello/world

I attempted to convert to lighttpd specification:

url.rewrite-if-not-file = ( "^(.*)$" => "index.php/$1" )

However, it doesn't work. I suspect that is due to misuse of $1. I tried to use $0/%0 or something else but they fail.

Would you please provide me a hint on making the syntax work? Thank you!

© Server Fault or respective owner

Related posts about mod-rewrite

Related posts about .htaccess