これを使用Redirect::to($url)
すると、結果は次のようになります。
http://localhost/http://mysite.com/foo/bar.html
しかし、私がRedirect::to('http://google.com')
それを使用すると、問題なくグーグルに行きます。私の問題は何だと思いますか?
これを使用Redirect::to($url)
すると、結果は次のようになります。
http://localhost/http://mysite.com/foo/bar.html
しかし、私がRedirect::to('http://google.com')
それを使用すると、問題なくグーグルに行きます。私の問題は何だと思いますか?
メソッドに完全修飾 URL を提供する必要がありますRedirect::to()
。そうしないと、アプリケーションのベース URL が先頭に追加されます。
$url = 'www.google.com';
// redirects to http://localhost:8888/www.google.com
return Redirect::to($url);
$url = 'http://google.com';
// redirects to http://google.com
return Redirect::to($url);
外部ドメインにリダイレクトするには、tiqeet.com などの完全修飾 URL を使用します
コントローラーで、return Redirect::intended("完全修飾ドメイン"); を呼び出します。
それがあなたのために働くことを願っています。laravel 4.0で使用しました