laravel5.* 在本地环境中 会出现路由问题: The requested URL /welcome was not found on this server.
经过踩坑,1.重启服务(无效) 2. 清理 laravel 缓存依然无效
最后发现其原因,是在public 文件夹下缺少 .htaccess 文件 路由无法进入虚拟目录中
可按照如下操作解决:
1、public目录下新建一个
public\.htaccess
2、填入下面内容
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>