技术文摘

设计,技术,行业

ThinkCMF在phpEnv开启rewrite伪静态方法

填写伪静态规则:

location / {
       index  index.php index.html index.htm;
        if (!-e $request_filename)
        {
           rewrite ^/(.*)$ /index.php?s=$1;
        }
   }
location /api/ {
       index  index.php index.html index.htm;
        if (!-e $request_filename)
        {
           rewrite ^/api/(.*)$ /api/index.php?s=$1;
        }
   }
location ~* \/upload\/.+\.(html|php)$ {
return 404;
}
location ~* ^\/plugins\/.+\.(html|php)$ {
return 404;
}
location ~* \/themes\/.+\.(html|php)$ {
return 404;
}