regexmod-rewritelighttpdclean-urls

Properly remove file extensions in URL in lighttpd


Could you advise me how to remove file extensions properly in lighttpd?

So that:

  1. Root directory ("/") is not going to be rewritten to "/.php"
  2. Open directory if trailing slash is missing
  3. All files can be accessed without extension

Another StackOverflow thread here have answers that do not fix (1): Rewriting with lighttpd - how to remove file extensions


Solution

  • 2) and 3) are mutually exclusive - how do you expect the system to know if blahBlah is meant to be a directory blahBlah or a file blahBlah.php?
    1) is probably handled by DirectoryIndex, not by your rewrite rules