how to enable mod rewrite in lighttpd

Ramesh picture Ramesh · May 7, 2010 · Viewed 9.8k times · Source

i need to enable mode rewrite in lighttpd it should no display the index.php extension ....

Answer

Kendall Hopkins picture Kendall Hopkins · May 7, 2010

If I'm understanding your question, you need to rewrite /index to /index.php. This should do the trick.

server.modules += ("mod_rewrite")
url.rewrite-once = ( 
    "^(.*)$" => "$1.php"
);

Note, this will also forward url's such as /image.jpg -> /image.jpg.php. If you need a more complex solution please adjust your question.