從1.4.24版本後多了一個新功能....mod_rewrite_if-not-file
mod_rewrite是合乎你設定的條件就作用,
作用是當404 File Not Found且合乎你設定的條件時,才會有作用
以下節錄自lighttpd官方:
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. This closes feature request #985.
自己實際使用上的結果是:
除了 url.rewrite-if-not-file 以外,它什麼都不吃
用法是:
url.rewrite-if-not-file = (
"條件" => "rewrite目標"
)