Error Sorry, the page you are looking for could not be found. in laravel

1

I have a problem with this site it appears this error on the screen when I try to access it what can be this error how do i fix it.

My routes:

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});


Route::post('/', 'FormController@postContato');

O .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]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
# Habilitar o PHP 5.5
AddHandler application/x-httpd-php55 .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/php55/lib
</IfModule>
    
asked by anonymous 02.12.2016 / 16:43

1 answer

2

The folder /public and not the folder will be considered a route, if you do this will appear:

<?php
Route::get('/', function () {
    return view('welcome');
});

Route::get('/public', function () {
    return 'Olá, mundo!';
});
  

Do not use public, it's just to understand the routes

The problem is that you do not understand very well how Laravel works, you have to configure the ./public folder as the default Apache folder.

In this answer I explain how to use in production and development environment:

02.12.2016 / 16:54