1

I have this .htaccess

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

How can I convert it to run my website through Lighttpd ?

Thank you so much!

  • I think it's not possible without mod-magnet. But maybe someone can prove me wrong. Anyway, this is more for serverfault or superuser. – 0xC0000022L Apr 22 '11 at 13:13

1 Answers1

1

You should be able to use:

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

Make sure to enable mod_rewrite in lighttpd.conf and reload lighty.

url.rewrite-[repeat-]if-not-file New: For the 1.4.x branch as of 1.4.24 or r2647 from svn:

Rewrites a set of URLs internally in the webserver BEFORE they are handled and checks that files do not exist.

Take examples from above, this is to mimic Apache´s "!-f" RewriteRule. Please note this does not work for directories, pipes, sockets or alike.

Where do I want to use this? Maybe with e.g. Drupal backend, where mod_magnet (has an Apache´s -f and -d solution) might not be handy or simply "too much" for just this kind of rewrites.