404错误laravel 4路由

编程入门 行业动态 更新时间:2024-10-18 08:26:28
本文介绍了404错误laravel 4路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我遇到麻烦,让路线找到一个页面,当我路由到它。我的路由设置和被识别为当我创建链接使用URL :: route('account-create')laravel将成功解析到'/ account / create'中我想要链接到哪里去。但是点击它,我得到一个404错误。

I am having troubles getting laravel to find a page when I route to it. My route is setup and being recognized as when I create link using URL::route('account-create') laravel will successfully parse that into '/account/create' as to where I want the link to go to. But upon clicking it I get a 404 error.

我的路线

Route::get('/account/create', array( 'as' => 'account-create', 'uses' => 'AccountController@getCreate' ));

我的控制器

class AccountController extends BaseController { // view the create user form public function getCreate() { //return View::make('account.create'); } }

blade.php被创建并放在app / views下的帐户文件夹中。注释或取消注释没有区别。 404仍然存在。

The create.blade.php is created and put inside an account folder under app/views. commenting or uncommenting makes no difference. The 404 remains.

我也试过:

Route::get('/account/create', function() { return 'Hello World'; });

在我的routes.php中仍然保留404

in my routes.php still the 404 remains

有没有一些配置我缺少?

Is there some configuration I am missing?

推荐答案

在看了一些之后,我发现我需要启用rewrite_module apache 。使得完美的意义真的,如何可以laravel做清洁urls如果它不能重写url。我知道这很容易解决。

After looking around some more I discovered I needed to enable rewrite_module on apache. Makes perfect sense really, how can laravel make clean urls if it cant rewrite the url. I knew it was going to be something simple to fix.

非常感谢您的回复

更多推荐

404错误laravel 4路由

本文发布于:2023-10-31 13:20:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546202.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路由   错误   laravel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!