一步一步的排查问题,首先,肯定是服务器配置出了问题,和代码无关。
于是去看nginx.conf,在网上查了很多关于这个问题的解决办法,说的大致都一样,就是在
location / { root D:/phpstudy_pro/WWW/Unifiedtransform/public/; index index.html index.htm index.php; gzip_static on; if (!-e $request_filename){ rewrite ^/(.*) /index.php last; } }
插入
try_files $uri $uri/ /index.php?$query_string;
但是还是没有解决问题,后来往下看,看到这里引用了 vhost/*.conf
所以要在对应的vhost文件下的localhost /{}中加入这行代码,就像这样: