【发布时间】:2017-05-08 16:52:39
【问题描述】:
我在 /var/www/html/blog/routes/web.php 中有以下内容
Route::get('/', function () {
return view('welcome');
});
Route::get('test', function () {
return view('test', ['name' => 'Chris']);
});
如果我转到 http://52.214.14.137,那么我会看到 /var/www/html/blog/resources/views/welcome.blade.php。
如果我去如果我去http://52.214.14.137/test,那么我希望看到 /var/www/html/blog/resources/views/test.blade.php 但我看到的是 404。
我错过了什么?
【问题讨论】:
-
是不是来自 Laravel 本身的 404 错误(你可以通过灰屏和堆栈跟踪来判断)?还是 Apache/NGINX 发出的 404 错误?
-
看起来像 Apache 404 错误
-
只是为了确定,您能否提及 laravel 版本、
.env文件中的APP_DEBUG值以及公共目录中的.htaccess文件? -
如果是 Apache 错误,则意味着您的 Web 服务器没有将请求正确路由到 Laravel 的
index.php。确保您的域设置为尊重.htaccess文件和 make sure you have the appropriate configurations applied in your public folder,或直接在您的虚拟主机配置中应用这些规则。 -
嗨。 Laravel 5.3.28,APP_DEBUG 为真,我还没有碰过 .htaccess 文件
标签: laravel