lundi 30 avril 2018

Laravel routing different in two ambients

I have 2 ambients, one for Local development (in Ubuntu for Windows 10), where I run my server withphp artisan serve --port=123 and I access through http://127.0.0.1:123/ and another one in a shared host called Dev, where I access to through this URL: http://dev.example.com/my_project/public/

In my routes I have this:

Route::redirect('/', '/inicio', 301);
Route::get('inicio', 'DashboardController@index')->name('inicio');

In Local, when I access to http://127.0.0.1:123/ it redirects to http://127.0.0.1:123/inicio which is correct. But in Dev if I join to http://dev.example.com/my_project/public/ it redirects to http://desa.laravel.com/inicio Why is happening that?. Plus, in Local and in Dev, if I use: href=""> both sites sends me to where I need, which is http://127.0.0.1:123/inicio and http://dev.example.com/my_project/public/inicio respectively.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire