phpStudy下nginx环境访问url去掉index.php

修改配置文件vhosts.conf:

在location / { } 中添加这段代码:

location / {
    index  index.html index.htm index.php;
    #autoindex  on;
	if (!-e $request_filename) {
        rewrite ^(.*)$ /index.php?s=/$1 last;
        break;
    }
}
        
发布了103 篇原创文章 · 获赞 167 · 访问量 18万+

猜你喜欢

转载自blog.csdn.net/msllws/article/details/100573511