Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com 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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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