Thinkphp设置伪静态
Nginx环境:在nginx.conf文件中添加
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
如果网站部署在二级目录,则在代码中加入文件路径
location /cn/ {
if (!-e $request_filename){
rewrite ^/cn/(.*)$ /cn/index.php?s=/$1 last;
}
}