【发布时间】:2017-04-06 22:46:01
【问题描述】:
我刚刚设置了我的作曲家并安装了一个新的 laravel 5.4 项目,并为 apache 服务器设置了一个虚拟主机。
虚拟主机配置
新应用的主页laravel.app运行良好
但是当我添加一个新视图并为其设置路线时,例如:
//This is The default Home page route
Route::get('/', function () {
return view('welcome');
});
// This is the new Route
Route::get('/hello',function(){
return view('hello'); // I created another view with the name hello.blade.php
});
当我尝试使用链接 laravel.app/hello 访问它时,我收到此错误:
找不到
在此服务器上找不到请求的 URL /hello。阿帕奇/2.4.18 (Ubuntu) 服务器在 laravel.app 端口 80
我要提一下我的操作系统是 Ubuntu 16.04
【问题讨论】:
-
<Directory>在 hosts 文件中完全错误... -
我可以删除它因为我最近添加了它但仍然是同样的问题
-
mod_rewrite是否已安装并处于活动状态,并且公用文件夹中存在.htaccess文件? -
@Philipp 如您所见,我删除了它,但它仍然一样。
-
.htaccess 存在于公用文件夹中,但第一件事
mod_rewrite我不明白。
标签: php apache laravel-5.4