Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sorry, the page you are looking for could not be found without showing any error : Laravel 5.5

Newly installed Laravel 5.5 showing Sorry, the page you are looking for could not be found. without any error . Please see the screenshot : enter image description here

I think its not even looks into routes file, this is my routes.php and htaccess enter image description here

enter image description here

What will be the reason for this ?

like image 938
Sujeesh S Avatar asked Sep 01 '17 03:09

Sujeesh S


2 Answers

All your WEB routes will be located in the file:

routes\web.php

Register your routes there.

like image 159
Arthur Samarcos Avatar answered Sep 20 '22 15:09

Arthur Samarcos


Order

Pay attention to routes order, it's really important (fooled me so many times to be honest).

Because Laravel goes through list of routes top to bottom until it finds the first match, as a rule of thumb, try to define routes with no parametres first then routes with parameters in your route file (web/api).

Example: (based on Radical's answer)

Route::get('/blog/{id}', 'BlogController@show');

Route::get('/blog/comments', 'BlogController@comments');

In this case, Route::get('/blog/{id}', 'BlogController@show'); comes first so it would be selected. Even when what you really want is Route::get('/blog/comments', 'BlogController@comments');

My two cents :)

like image 40
chebaby Avatar answered Sep 21 '22 15:09

chebaby