【发布时间】:2014-07-25 18:41:53
【问题描述】:
我搭建了一个laravel4项目,但是路由只对路由/有效。
我也为项目设置了一个vhost,vhost指向laravel4/public
我在 routes.php 中有以下代码
Route::get('/', function()
{
return View::make('home');
});
Route::get('help', function() {
return "asdfsafas";
});
当我转到 / 时,它显示正确。但是如果我去 /help,它会显示 The requested URL /help was not found on this server.
【问题讨论】:
-
哦,我忘了添加 index.php :( 在我输入 xxxx.dev/index.php/help 后,它可以工作。但是如果只输入 xxxx.dev/help,我怎样才能让它工作?
-
你所拥有的应该可以正常工作 - 你使用什么作为 http 服务器,apache?在你的 laravel 根目录中使用 'php artisan serve' 试试。