C.ryudo C.ryudo - 1 year ago 110
PHP Question

Laravel5:Redirect::to() outside link NotFoundHttpException in RouteCollection.php

I'm developing a Laravel 5 app, I have this route


and in this UrlController.php,I have this index method

public function index(){
return Redirect::to('www.google.com',302);

when I test this url

it just change to
and have this error
NotFoundHttpException in RouteCollection.php line 161

so what the problem is , Thanks

Answer Source

you should add protocol before the www.google.com

public function index(){
    return Redirect::to('https://www.google.com',302);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download