I have just created my first project with Laravel, and I am following all the steps little by little. But I find myself stuck with an error that I can not solve.
When editing the web.php file in the routes directory, it happens that no route you add works. Only the main route to the root works. All others return ERROR 404 .
Example:
Route::get('/', function () {
return ('bienvenida');
});
Route::get('/hola', function()
{
return ('hola mundo');
});
By opening domain.com/public/ I get the message " welcome ".
By opening domain.com/public/hola I get a 404 error .
However, if I go to domain.com/public/index.php/hola I get the " hello world ".
This is not how the routes should work. That is, you should not have to type "index.php" to continue writing the route. Does anyone know this problem and know how to fix it?
Thank you very much in advance!