Laravel 5.1 Route object not found
Please help me, I am working on Laravel using the latest version of xampp and do not know what is the cause of my problem.
This route works fine:
Route::get('/', function () {
return 'aa';
});
This route gives the error "Object not found!":
Route::get('about', function () {
return 'aaa';
});
httpd.vhosts:
<VirtualHost test.loc:80>
DocumentRoot "C:/xampp/apps/test.loc/public"
ServerName test.loc
<Directory "C:/xampp/apps/test.loc/public">
#AllowOverride All - when I use this, I get a "Access forbidden!" for all routes
Require all granted - this works for the main route, other routes give "errors".
</Directory>
/public/.htaccess:
<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]
+2
source to share
3 answers