thinkcmf5宝塔liunx版Nginx环境开启伪静态


thinkcmf5宝塔liunx版Nginx环境开启伪静态步骤。

1、绑定网站运行目录

2、填写伪静态规则:

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;
}

3、保存,OK!


评论


乖,登录后才可以留言!