Laravelのルーティングで「全てのパス」を指定するには、
{all} をパスの部分に指定すればよい。
下記のように。
routes/web.php
Route::get('{all}', function() {
return redirect('/');
});
上記をweb.phpの末に記載すれば、GETリクエストでマッチするパスがなかった際に、ルートにリダイレクトされるようになる。
Go to list of users who liked
More than 3 years have passed since last update.
Laravelのルーティングで「全てのパス」を指定するには、
{all} をパスの部分に指定すればよい。
下記のように。
Route::get('{all}', function() {
return redirect('/');
});
上記をweb.phpの末に記載すれば、GETリクエストでマッチするパスがなかった際に、ルートにリダイレクトされるようになる。
Register as a new user and use Qiita more conveniently
Go to list of users who liked