Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question

migrated from Apr 23 '11 at 22:53

This question came from our site for professional and enthusiast programmers.

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

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.

share|improve this answer
Thank you!!!! works – Damiano Apr 22 '11 at 16:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.