Lighttp Rewrite Rule For WordPress

根目录安装是这样的:

url.rewrite-once = (
"^/(.*)?/?files/$" => "index.php",
"^/(.*)?/?files/(.*)" => "wp-content/blogs.php?file=$2",
"^/(wp-.*)$" => "$1",
"^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "$2",
"^/([_0-9a-zA-Z-]+/)?(.*\.php)$" => "$2",
"." => "index.php"
)

wordpress 可以自动实现 域名无 www 向有的跳转,其他程序可以依靠:

$HTTP["host"] !~ "^(www|mail|mysql)\.(domain\.org)$" {
  $HTTP["host"] =~ "^(.+\.)?(domain\.org)$" {
    url.redirect = (
      "^/(.*)" => "http://www.%2/$1"
    )
  }
}

实现跳转。