作成日:2017-12-07, 更新日:2017-12-07
基本
- 302リダイレクト(一時的な転送処理にしたいとき→302)
-
\Response::redirect('http://example.com/home');
- 301リダイレクト(恒久的な転送処理にしたいとき→301。旧ページが無くなったときとか)
-
\Response::redirect('http://example.com/home', 'location', 301);
- 404ページへリダイレクト
-
throw new HttpNotFoundException;
- 強制的にページ遷移(ステータスコード:200)
-
\Response::redirect('http://example.com/home', 'location', 200);