qq_H_213
2018-04-18 15:36
我在routes.php里写得路由访问不了怎么回事啊老师? 把他原来自带得路由原先是‘/’可以访问,但是改下名字也不行了。。才入坑求解
The requested URL /php/laravel/public/member/info was not found on this server.
你没有URL重写,就是把入口文件省略做配置。如果没配置的话,每一个URL都加上index.php的入口文件。
你是什么环境的,我之前遇到过这种问题,我是 nginx 的环境,要修改nginx的配置文件就可以了
server { listen 80; server_name test.laravel.local; access_log /home/wwwroot/default/logs/access_laravel.log; error_log /home/wwwroot/default/logs/error_laravel.log; root /home/wwwroot/default/laravel5/public; index index.html; location / { index index.php; try_files $uri $uri/ /index.php?$query_string; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; } } location ~ .+\.php($|/) { set $script $uri; set $path_info "/"; if ($uri ~ "^(.+\.php)(/.+)") { set $script $1; set $path_info $2; } fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php?IF_REWRITE=1; include fastcgi_params; fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root/$script; fastcgi_param SCRIPT_NAME $script; } }
轻松学会Laravel-基础篇
64171 学习 · 281 问题
相似问题