Friday, September 22, 2017

lighttpd 环境下添加rewrite(伪静态)规则

VPS Linux 服务器系统默认已经开启了伪静态功能,但是需要在kloxo中自行添加所用程序的伪静态规则。
在admin-domains-script-lighttpd rewrite rule中填写:
WordPress lighttpd的rewrite(伪静态)规则如下

url.rewrite = (
"^/(wp-.+).*/?" => "$0",
"^/(sitemap.xml)" => "$0",
"^/(xmlrpc.php)" => "$0",
"^/(.+)/?$" => "/index.php/$1"
)

Discuz lighttpd的rewrite(伪静态)规则如下


url.rewrite-once = (
"^/archiver/((fid|tid)-[w-]+.html)$" => "archiver/index.php?$1",
"^/forum-([0-9]+)-([0-9]+).html$" => "forumdisplay.php?fid=$1&page=$2",
"^/thread-([0-9]+)-([0-9]+)-([0-9]+).html$" => "viewthread.php?tid=$1&extra=page=$3&page=$2",
"^/space-(username|uid)-(.+).html$" => "space.php?$1=$2",
"^/tag-(.+).html$" => "tag.php?name=$1"
)

2 comments

  1. 重新启动lighttpd服务试试看。

  2. 博主啊,我也是这么添加的,但是开启伪静态后网站的子目录都无法访问,比如说/images/ /beifen/.
    这些原来存在的目录都无法显示,是怎么回事呢?

Leave a Reply

Your email address will not be published. Required fields are marked *