Our entire site is to be served over https. I have 'https' in each route. However, how do I redirect them to https if they attempt it over http? Route::group(array('https'), function() { // all of our routes }
![Laravel Redirect All Requests To HTTPS](https://cdn-ak-scissors.b.st-hatena.com/image/square/98d6f053a97a87156775f60757c60865d0f2c47d/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded)
最近、Webサイトに対する攻撃が増えてたり、SPDY がじわじわ普及しているのでこれからの Web サイトは総 https 化するんじゃないかなーと思ってます。 なので、お手元で開発されているアプリケーションもいつでも対応できるようにしておいたほうが後々楽になるんじゃないかと。まぁ .htaccess でもいいんですが、Laravel だとこんなに楽だよという話をします。 app/filters.php にこんな感じで書きます。 <?php App::before(function($request) { if (!$request->isSecure()) { return Redirect::secure($request->path()); } }); 簡単ですね before フィルターで URL のチェックをして http なら https にリダイレクトしてます。このままだとロ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く