404 in Application with Laravel. Problems with .htaccess

0

I have a php development environment with Ubuntu 18.04. In this environment I have two versions of PHP, 5.6 and 7.1 by necessity of some projects.

I created a new project using Laravel 5.6 (php 7.1), I created the project with the composer without problems, I made a virtual host in apache for the public directory of my project and everything is fine.

However, when I try to access any route other than the initial route, error 404 occurs.

Note that when I add /index.php/register to the URL, the page works.

My virtualhost is configured as follows:

<VirtualHost *:80>
    ServerName tales.local
    ServerAdmin webmaster@localhost
    DocumentRoot  /home/mario/sandbox/tales/public
    ErrorLog ${APACHE_LOG_DIR}/tales-error.log
    CustomLog ${APACHE_LOG_DIR}/tales-access.log combined
    <Directory  /home/mario/sandbox/tales/public>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

And the .htaccess file of the project public folder looks like this:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>
    Options +FollowSymLinks
    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Any idea what it might be?

    
asked by anonymous 02.04.2018 / 17:01

0 answers