嘗試使用magnet-module + lua腳本
附加磁鐵模塊到lighttpd的模塊
server.modules = (
...
"mod_magnet",
...
)
lighttpd的虛擬主機例如:
$HTTP["host"] =~ "^(example.com)$" {
server.document-root = "/var/www/example.com/document_root"
magnet.attract-physical-path-to = (server.document-root + "/rewrite.lua")
}
創建的文件夾的document_root文件rewrite.lua(根據上面的設置)
attr = lighty.stat(lighty.env["physical.path"])
if (not attr) then
lighty.env["uri.path"] = "/index.php"
lighty.env["physical.rel-path"] = lighty.env["uri.path"]
lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]
end
-- uncomment below for debug output to stdout
-- print ("final file is " .. lighty.env["physical.path"])
信用爲這個職位去「edke」用戶從nette forum thread
可能是值得嘗試的也是這個(或獲得啓發):http://www.guyrutenberg.com/2008/05/24/clean-urls-permalinks-for-wordpress-on-lighttpd/
你需要的htaccess相當於FOT lighttpd的 - 見[類似的問題] [1] [1]:http://stackoverflow.com/questions/3654 765/Apache的htaccess的文件上,lighttpd的 – petrbel