900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > 根目录访问php 404 nginx配置后只有根目录首页index.php能访问 其他页面404

根目录访问php 404 nginx配置后只有根目录首页index.php能访问 其他页面404

时间:2019-09-19 00:35:49

相关推荐

根目录访问php 404 nginx配置后只有根目录首页index.php能访问 其他页面404

我本地是window系统,用的是phpstudy,解决办法:用phpstudy点击其他选项菜单->打开配置文件->选择vhost-ini(或者找到nginx安装目录,打开vhost.conf),在你的站点配置里

location / {

index index.html index.htm index.php;

#autoindex on;

}

改为

location / {

index index.html index.htm index.php;

try_files $uri $uri/ /index.php?$query_string;

if (!-e $request_filename){

rewrite ^/(.*) /index.php last;

}

#autoindex on;

}

最后重启nginx,就搞定了。

原文:/xiesx/p/11375779.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。