PHP Laravel路由问题 [英] PHP Laravel Routing Issue

查看:106
本文介绍了PHP Laravel路由问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的设置当前看起来像这样

My setup currently looks like this

application/controllers/register.php

application/controllers/register.php

class register_Controller extends Base_Controller
{
    public $restful = true;
    public function get_index()
    {
        return View::make('main.register');;
    }
}

routes.php

routes.php

Route::controller(Controller::detect());
Route::any('/', function()
{
    return View::make('main.index');
});
Route::any('register',function()
{
    return View::make('register.index');
});

mydomain.com有效.

mydomain.com works.

mydomain.com/index提供了一个laravel 404

mydomain.com/index gives a laravel 404

mydomain.com/register给出了标准404

mydomain.com/register gives a standard 404

奇怪的是mydomain.com/register不应该给我laravel 404错误吗? 页面表明WAMP是原因,但我的设置在Ubuntu上运行PHP5,Apache2和mySQL的VM.

What's strange is that shouldn't mydomain.com/register give me a laravel 404 error? This page indicates that WAMP was the cause, but my setup is on a Ubuntu VM running PHP5, Apache2, and mySQL.

推荐答案

在启用mod_rewrite的情况下,尝试在apache配置中设置"AllowOverride All",它为我修复了该问题.

With mod_rewrite on, try setting in apache configurations "AllowOverride All", it fixed it for me.

这篇关于PHP Laravel路由问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆