2

I have a problem with some "routes" in my old Laravel 5.1.46 project.

When I try to access to some routes, like admin/exercices/creer or admin/exercices/1928, I have this: "Sorry, the page you are looking for could not be found.". I can access to thoses pages when I work on the test or local serveur. But not on the production serveur. Other routes like admin/missions/creer are working properly.

enter image description here

I tried php artisan route:list to compare the routes on each serveur: it's the same everywhere. I also tried php artisan route:cache and php artisan route:clear. Nothing changed.

I can remember we changed the routes path (for example: "admin/modules/creer" became "admin/exercices/creer"). I think we did it manually, directly in the routes.php file. But it waas a long time ago and since then, it already worked properly. So I don't think it comes from that, but Idk.

I'm also not good at sysadmin, so maybe it's more about the config of the server than code and laravel... In this case, any idea here does it come from? I have no clue, and I might need help.

Thanks a lot for reading! And let me know if you have even a tiny idea!

  • Does this only affect some of the routes? or is it more like all the routes except the home route? – apokryfos Jan 31 '22 at 16:28
  • Just some of them! – Marjolaine Vé Jan 31 '22 at 16:30
  • If you do e.g. `/index.php/admin/exercices/creer` would it work? If it does then there might be conflicts between your Laravel routes and server configuration e.g. maybe the server has reserved mapping `admin` for other reasons. If you have configured the server on a central configuration file then maybe check if you can add exceptions to your own routes there – apokryfos Jan 31 '22 at 16:33
  • Thanks for your idea! Unfortunately, it's not working either, I still have the "Sorry, the page you are looking for could not be found" message. – Marjolaine Vé Jan 31 '22 at 16:38
  • is that a webserver 404 error or a laravel 404 error? – lagbox Jan 31 '22 at 16:46
  • I think it's the laravel 404 error, because it has its design (typo & color). – Marjolaine Vé Jan 31 '22 at 16:48
  • did you try ```php artisan route:clear``` and then ```php artisan route:cache``` ? – newbie Jan 31 '22 at 17:14
  • I did, everything is cleared and cached successfully! – Marjolaine Vé Jan 31 '22 at 17:30
  • 2
    that is a `ModelNotFoundException` that is being converted to a 404 ... somewhere something is trying to retrieve a Model but failing (perhaps route model binding) ... it would seem the record you are looking for doesn't exist – lagbox Jan 31 '22 at 18:39

0 Answers0