nginx thinkphp laravel伪静态

thinkphp

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.php?s=$1;
         }
    }

    location ~* ^\/upload\/.+\.(html|php)$ {
        return 404;
    }

    location ~* ^\/plugins\/.+\.(html|php)$ {
        return 404;
    }

    location ~* ^\/themes\/.+\.(html|php)$ {
        return 404;
    }



laravel

location / {       
    try_files $uri $uri/ /index.php?$query_string;
}


打赏

看恩吧
网站不承担任何有关评论的责任
  • 最新评论
  • 总共条评论
取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦