Laravel - Getting NotFoundHttpException in RouteCollection.php line 161 for each controller -
i moved project new server.
i did following:
composer update php artisan migrate php artisan cache:clear
but im getting error message:
notfoundhttpexception in routecollection.php line 161:
for each controller. idea why ?
[update]
this content of routes/web.php file:
route::get('/', function () { return view('welcome'); }); route::group(['middleware' => 'web'], function () { route::auth(); route::get('/orders', 'orderscontroller@index'); }); route::group(['middleware' => 'web'], function () { route::auth(); route::get('/shipments', 'shipmentscontroller@index'); });
this works fine on localhost, not on new server reason.
[update] - .htaccess public folder
<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes if not folder... rewritecond %{request_filename} !-d rewriterule ^(.*)/$ /$1 [l,r=301] # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] # handle authorization header rewritecond %{http:authorization} . rewriterule .* - [e=http_authorization:%{http:authorization}] </ifmodule>
this issue routes defined route declaration, make sure have defined route url trying access.
edit
could please update question .htaccess
code? may problem this. means url www.example.com/laravel
route should start laravel not /
.
update routes/web.php
route::get('/', function () { return view('welcome'); }); route::group(['middleware' => 'web'], function () { route::auth(); route::get('/orders', 'orderscontroller@index'); route::get('/shipments', 'shipmentscontroller@index'); });
make change combine route group.
Comments
Post a Comment