duanrong3308 2014-07-10 02:29
浏览 80
已采纳

为什么我的Laravel路线不起作用? mod_rewrite已启用

I have the simple code in my routes.php:

Route::get('/', function()
{
    return View::make('hello');
});


Route::get('/mypage', function()
{
    echo 'mypage';
});

Visiting mysite.dev/ will return the hello view. However, visiting mysite.dev/mypage gives me a 404. In my phpinfo(); I'm showing mod_rewrite enabled (as seen here: https://www.dropbox.com/s/u972n1rcdbsambg/Screenshot%202014-07-09%2022.27.04.png)

Any idea why this wouldn't work? I'm running Mac OS X Mavericks with apache2 and PHP with Laravel 4.

  • 写回答

3条回答 默认 最新

  • duanquan1243 2014-07-10 08:24
    关注

    Have you changed this from

    AllowOverride None

    to

    AllowOverride All

    in your apache2.conf?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?