分类: IT职场
2013-08-01 10:07:23
nginx 默认是没有支持thinkphp的url伪静态
在nginx的配置文件中加入以下的内容就可以支持url伪静态
还需要到thinkphp中把模式改为2
=====================================================================
location / {
index index.php;
if (!-e $request_filename) {
rewrite /(.*) /index.php/$1 last;
}
break;
}
location ~ .+\.php($|/) {
set $script $uri;
set $path_info "/";
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info $2;
}
====================================================================
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
这还需要到thinkphp中把模式改为1