phpstudy_xxx/extenxxxx/nginx/config/进vhosts找到自己的项目配置文件
将
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
#autoindex on;
}`在这里插入代码片`
加到server里 隐藏index.php
记住配置完成后一定要重启一下nginx
配置文件
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME
d
o
c
u
m
e
n
t
r
o
o
t
document_root
documentrootfastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED
d
o
c
u
m
e
n
t
r
o
o
t
document_root
documentrootfastcgi_path_info;
include fastcgi_params;
这是原来的location里的,不用动