Laravel routing 404 error not found

问题描述:

所以我在学习Laravel,为了让我的网站更加用户友好,我目前正在观看YouTube视频以学习Laravel,同时在本教程中(https://www.youtube.com/watch?v=aJNKc7GWiAI)我可以'似乎无法访问路线。Laravel routing 404 error not found

routes.php文件

<?php 

Route::get('/', array (
'as' => 'home', 
'uses' => '[email protected]' 
)); 

/* 
Unauthenticated group/not logged in 
*/ 

Route::group(array('before' => 'guest'), function() { 

/* 
CSRF protection group 
*/ 

Route::group(array('before' => 'csrf'), function() { 

}); 

/* 
Create account (GET) 
*/ 
Route::get('/account/create', array (
'as' => 'account-create', 
'uses' => '[email protected]' 
)); 
}); 

账户控制器

<?php 
class AccountController extends BaseController { 

    public function getCreate() { 

    } 

    public function postCreate() { 

    } 


} 

错误消息

所请求的网址/ laravel /登录/公/帐号/创建不在这台服务器上找到。

本地站点是在C:\ WAMP \ WWW \ laravel \登录

编辑: 我也文件上传到Web服务器,但仍不能工作。这里的网址。

http://178.62.98.162/laravel/login/public/account/create 

.htaccess文件不存在在公共文件夹

您的服务器未配置为使用它

+0

我在公共文件夹中的.htaccess文件,这里是代码。 选项-MultiViews RewriteEngine叙述在 #重定向结尾的斜杠... 重写规则^(。*)/ $/1 $ [L,R = 301] #手柄前端控制器... 的RewriteCond%{} REQUEST_FILENAME!-d 的RewriteCond%{} REQUEST_FILENAME!-f 重写规则^的index.php [L] Josh 2014-12-06 13:44:41

+0

您需要启用的.htaccess在你的服务器。 [链接](http://tildemark.com/enable-htaccess-on-apache/) – 2014-12-06 13:50:01

+0

工作过的魅力!非常感谢。我会upvote,但目前不能。 – Josh 2014-12-06 13:54:46

首先编辑你的根目录下WAMP到laravel /登录/公有的,因此你不必在每次的网址添加公众同一编辑httpd.conf文件和/或vhosts.conf文件的网站,你想改变。通过Directory指令可以指定本网站的 文件的位置。点击左侧的Wamp图标并通过apache/httpd设置,你会得到它。