Laravel5.0.16の初期設定をおこないました。(phpは5.4.40)
/(スラッシュ)で
Laravel 5
Simplicity is the essence of happiness. - Cedric Bledsoe
のようこそ画面が見れたので、ルーティングもうまく読み込めたとおもったのですが、
それ以外のURIをつけたときの挙動がうまくいきません。
ルーティングの設定は下記になります。(ほぼ初期からなにもいじってない)
「hello」の部分だけ追記しました。(一番下)
<?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 controller to call when that URI is requested.
|
*/
Route::get('/', 'WelcomeController@index');
Route::get('home', 'HomeController@index');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);
Route::any('version', function()
{
$laravel = app();
return "Current Laravel Version: " . $laravel::VERSION;
});
Route::get('hello/', function()
{
return 'Hello World';
});
これでhttp://IPアドレス/helloにアクセスしても
404NOT FOUNDになってしまいます。
/(スラッシュ)だけだとなぜようこそページが見れて、
それ以外が404ページになってしまうのかg教授よろしくお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/05/02 07:19