【发布时间】:2014-03-16 10:01:49
【问题描述】:
我正在开始一个新的 Laravel 项目,我定义了一个路由,这是我的 routes.php 文件
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('signup', function()
{
return View::make('signup');
});
Route::get('/', function()
{
return View::make('welcome');
});
当我尝试加载页面时http://localhost/laravel-project/public/signup
我得到一个 HttpNotFoundException 我运行工匠路线并且路线注册存在。我该如何解决这个问题?
【问题讨论】:
-
请提供有关您的系统的更多信息:- MAMP/ XAMMP - vhost 配置 - 等等...然后我们可以找出问题所在。
-
您确实在
views文件夹中创建了signup.blade.php? -
除非我们从您那里获得更多信息。那我们哪儿也不去。首先尝试
http://localhost/laravel-project/public/index.php/signup,您可能没有正确设置htaccess。 -
我不认为问题出在服务器上,因为我有另一个 laravel 项目并且它工作正常
-
我在view文件夹下创建了signup.blade.php