thinkcmf伪静态文件

由 Jefsky 发布于 2024-06-13

thinkcmf伪静态文件

location / {
    if (!-e $request_filename){
        rewrite  ^(.*)$  /index.php?s=$1  last;   break;
    }
}
location /api/ {
  index  index.php index.html index.htm;
  #如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
  if (!-e $request_filename)
  {
  #若是子目录则使用下面这句,将subdir改成目录名称即可。
  rewrite ^/api/(.*)$ /api.php?s=$1;
  }
}

著作权归作者所有。
商业转载请联系作者获得授权,非商业转载请注明出处。
作者:JefskyWong ——程序猿甜品店
链接:https://www.jefsky.com/blog/335
来源:https://www.jefsky.com/