laravel路由無法訪問
被這個問題折騰了 好幾次了,記錄一下希望可以幫到后面的朋友
在laravel路由中配置好了之后無法訪問的問題有可能是因為在本地服務配置的問題(我使用的是nginx服務器)
找到nginx所在文件,打開conf/vhosts/'你的站點名稱'
修改location(如下)
server {
listen 80;
server_name localhost;
root "D:/laravel/public";
location / { index index.php index.html error/index.html; try_files $uri $uri/ /index.php?$query_string; } 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; } }
將原來的location改善上面的保存,重啟服務器即可