laravel配置路由出现404解决办法
2018-01-11 11:19
1066 查看
问题分析
一般出现这种情况的都是apache/nginx配置出现问题
问题解决
nginx解决办法
在location里面加上 try_files $uri $uri/ /index.php?$query_string;
如果配置文件中存在 try_files $uri $uri/ =404;需要将它注释掉或者删掉,否则会报错
本人的nginx配置(我是在域名里面进行配置的)
[plain] view
plain copy
server {
listen 80;
server_name www.onlinebook.com;
root /home/developer/Desktop/www/laravel_book/public/;
index index.html index.php index.htm;
location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
一般出现这种情况的都是apache/nginx配置出现问题
问题解决
nginx解决办法
在location里面加上 try_files $uri $uri/ /index.php?$query_string;
如果配置文件中存在 try_files $uri $uri/ =404;需要将它注释掉或者删掉,否则会报错
本人的nginx配置(我是在域名里面进行配置的)
[plain] view
plain copy
server {
listen 80;
server_name www.onlinebook.com;
root /home/developer/Desktop/www/laravel_book/public/;
index index.html index.php index.htm;
location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
相关文章推荐
- laravel配置路由出现404解决办法
- laravel配置路由除了根目录出现404解决办法(nginx)
- laravel配置NGINX路由出现404解决办法
- laravel配置路由出现404解决办法
- tp5 url 线上访问 在nginx 上 出现404错误,解决办法(1.80nginx 配置 pathInfo)
- AspNet Mvc 路由解析中添加.html 等后缀 出现404错误的解决办法
- eclipse配置servlet出现,第一次500,第二次404,的若干解决办法
- laravel+Apache 路由404问题解决办法
- tp5 url 线上访问 在nginx 上 出现404错误,解决办法(1.80nginx 配置 pathInfo)
- 由于权限不足而无法读取配置文件出现的HTTP 500.19解决办法
- 关于wordpress设置固定链接后文章出现404的解决办法
- Myeclipse6.5+weblogic8.1老是配置文件出现,sax解析错误,不能解析web-app的解决办法
- linux下出现ping:unknown host www.baidu.com问题时的解决办法——ubuntu下局域网络的配置
- MyEclipse8.5配置tomcat7.0 出现A java Exception has occured的解决办法
- git配置的时候出现connect to host github.com port 22 bad file number解决办法
- Wampserver2.5配置虚拟主机出现403 Forbidden解决办法
- Fedora19启动时“出现无法应用原保存的显示器配置”解决办法
- SQL SERVER 2008 配置管理器出现“远程过程调用失败”【0x800706be】的解决办法
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
- Wampserver2.5配置虚拟主机出现403 Forbidden解决办法