0
我對MVC並不陌生,但對Laravel來說是新手。我已經設法在Windows 8.1上安裝WAMP。我轉到根URL(http://localhost/public/
)並獲取Laravel徽標和「您已抵達」。文本行。Laravel - 通往封閉的路線
現在我想玩點兒,the documentation告訴我,下面的代碼應該工作。
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('/', function()
{
return View::make('hello');
});
Route::get('users', function() {
return 'users!';
});
我應該得到的文本users
,當我瀏覽到http://localhost/public/users
,而不是我得到一個404什麼是我做錯了什麼?
你的代碼沒有問題 – 2014-10-09 12:08:11
嗯爲什麼我會得到404?在我做出改變後,我是否需要重新運行某些東西? – Ciwan 2014-10-09 12:08:59
您是否按照http://laravel.com/docs/4.2/installation#pretty-urls設置了您的Web服務器? – ceejayoz 2014-10-09 12:09:56