Reputation: 9
I redirect the user to another (external) website, but Laravel keeps routing back to my app's URI. My controller code is
public function showClientSite($councilUrl)
{
//return Redirect::to($councilUrl)
Redirect::away($councilUrl);
}
what i get is https://www.mywebsite/appname/public/http://www.clientwebsite.co.uk
But i want it to be http://www.clientwebsite.co.uk
Upvotes: 0
Views: 252
Reputation: 559
That should work.
Try
return Redirect::to('http://google.com');
or
return Redirect::away('http://google.com');
Away adds only Header and https status to response. Does your $councilUrl have an http:// prefix?
Upvotes: 0
Reputation: 25384
The redirect call in itself doesn't do anything - you need to return it from the function in order for Laravel to actually use it.
return Redirect::away($councilUrl);
Upvotes: 1