I create an app with Laravel framework in PHP.
I have a problem with routing.
.htaccess file looks like this:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A 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]
routes.php:
<?php
get('/', function () {
return view('welcome');
});
get('1', function() { return 'Je suis la page 1 !'; });
get('2', function() { return 'Je suis la page 2 !'; });
When I load http://localhost:63342/game/public/, server loads welcome.blade.php file, so it's okey. But when I want to load http://localhost:63342/game/public/1, I got error: 404 Not Found. I use appache server and I already enabled 'mod_rewrite' action. What can be problem?