Php 拉维路不工作
我有这条路线Php 拉维路不工作,php,laravel,Php,Laravel,我有这条路线 Route::get('/', function() { return 'foo'; //return View::make('hello'); //return View::make('world'); }); 当我键入http://localhost/laravel/,它显示foo 但是 随着这场溃败 Route::get('about', function() { return 'foo'; //retu
Route::get('/', function()
{
return 'foo';
//return View::make('hello');
//return View::make('world');
});
当我键入http://localhost/laravel/
,它显示foo
但是
随着这场溃败
Route::get('about', function()
{
return 'foo';
//return View::make('hello');
//return View::make('world');
});
和http://localhost/laravel/about
,我明白了
在此服务器上找不到请求的URL/laravel/about
请告诉我这里发生了什么。当您使用链接时:
localhost/laravel/index.php/about
route-works。这意味着您正在正确定义它们。问题出在服务器端。确保您的mod_rewrite
模块已启用
您正在使用Wamp。请尝试按照以下说明操作:
不,它不起作用。即使我这样做
route::get('',function()
而不是route::get('/',function()),路由也会工作
Wow这真的很管用。但是请你怎么解释。这里的答案解释了这一点。你没有启用mod_rewrite功能。你使用哪种服务器?如果这是其他Apache服务器,你需要将请求重定向到index.php;就像在Its Apache中一样,我使用的是Wamp