【ThinkPHP】ThinkPHP框架在nginx+https环境下无法去除index.php ?

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/gexiuhua/article/details/79286685

在服务器中之前使用http协议下,ThinkPHP框架的项目都能正常访问,但是换了https协议后,就出现无法虚拟化路径,即无法去除index.php文件,找到问题即解决方法:

修改nginx中的location配置项

    location ~ ^/.*$ {
        #if (!-e $request_filename) {
        #        rewrite ^/(.*)$ /index.php/$1;
        #}
        if (!-e $request_filename){
                rewrite ^/(.*)$ /index.php?s=$1 last;
        }
    }

这里写图片描述

猜你喜欢

转载自blog.csdn.net/gexiuhua/article/details/79286685