Linux下的 Lighttpd 与框架 ThinkPHP UrlReWrite 配置


首先修改Linux下lighttpd.conf文件

打开mod_rewrite前的#号注释

然后配置内加入

url.rewrite-once  = (
        "^/index.php(.*)$"                     => "/index.php/$1",
        "^/Public/(.*)$"                       => "/Public/$1",
        "^/Share/(.*)$"                        => "/Share/$1",
        "^/(.*)$"                              => "/index.php/$1",
)

这样tp框架就可以打开

如果使用官方的rpm包安装的,需要重新编译lighttpd

需要先安装pcre

配置两个变量LIB以及CPPFLGS值 根据pcre-config 输出结果配置

然后再configure lighttpd的包

make

make install

相关内容