Lighttpd的rewrite規則(帶子目錄)

var.wpdir 用來定義子目錄,比如我這個blog,var.wpdir=”/blog/”
如果是根目錄,var.wpdir=”/” 即可


var.wpdir = “/blog/”
url.rewrite-once = (
“^” + wpdir + “(wp-.+).*/?” => “$0″,
“^” + wpdir + “(sitemap.xml)” => “$0″,
“^” + wpdir + “(xmlrpc.php)” => “$0″,
“^” + wpdir + “keyword/([A-Za-z_0-9-])/?$” => wpdir + “index.php?keyword=$1″,
“^” + wpdir + “(.+)/?$” => wpdir + “index.php/$1″
)}

下面是wp mu用的。先記下備查吧
url.rewrite-once = (
“^/(.*)?/?files/$” => “index.php”,
“^/(.*)?/?files/(.*)” => “wp-content/blogs.php?file=$2″,
“^/([_0-9a-zA-Z-]+/)?(wp-.*)” => “$2″,
“^/([_0-9a-zA-Z-]+/)?(.*\.php)$” => “$2″,
“.” => “index.php”
)