laravel+nginx首页正常,其他页面出现404 Not Found
2020-07-15 05:43
1226 查看
解决方法
在nginx配置文件下面http里面添加如下代码:try_files $uri uri//index.php?uri/ /index.php?uri//index.php?query_string;
server { listen 127.0.0.1:80; server_name www.shoptest4.net.com; root "E:/phpstudy_pro/WWW/laravel/shoptest4/public/"; location / { index index.html index.htm index.php l.php; try_files $uri $uri/ /index.php?$query_string; autoindex on; } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } }
重启nginx就可以了
phptudy8
修改代码为,然后重启
相关文章推荐
- nginx配置后只有根目录首页index.php能访问,其他页面404
- nginx配置https之后只有首页能访问,其他页面404
- 关于在apache服务器环境下的项目上传nginx环境下页面只有主页正常,其他页面404的一种情况
- nginx配置后只有根目录首页index.php能访问,其他页面404
- window下的CI项目上传到linux下的nginx,浏览器只能访问首页,其他页面显示404
- NGINX 自定义404(或其他)error页面
- TP5在Linux deepin下Nginx其他页面404问题解决方法
- 项目上线后除了首页能展示,其他页面报404解决方法
- vue 在nginx下页面刷新出现404问题解决和在nginx下页面加载了js但是页面显示空白问题解决
- nginx 404 403等错误信息页面重定向到网站首页或其它事先指定的页面
- linux服务器能看到首页,其他页面404解决
- laravel学习笔记------laravel在nginx环境访问页面404
- ubuntu 下 wordpress 设置 Permalink 为 自定义结构后出现404页面 nginx - 404 not found page for permalinks
- 关于编译的yum安装nginx出现404页面原因
- laravel 在nginx服务器上除了首页其余都是404的问题
- laravel配置NGINX路由出现404解决办法
- 网站只有首页能打开,其他页面404
- tp3 除了首页,其他页面报错解决方案(nginx方案)
- 在写ssh项目时浏览器页面出现http status 404 – not found
- laravel 在nginx服务器上除了首页其余都是404的问题