Hello I am trying to integrate Laravel and Apache but the routes are not recognized by Apache.
Well I show the configuration that I have
in the virtutalHost of apache2 I have
<VirtualHost *:80>
#Alias /loginseg /var/www/html/otro/laravel/public
DocumentRoot "/var/www/html/otro/laravel/public"
<Directory "/var/www/html/otro/laravel/public">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
and in the .htaccess of the public of the project is
<IfModule mod_rewrite.c>
Options +FollowSysmLinks
RewriteEngine On
RewriteBase /
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Authorization Headers
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
the main page works perfectly but when I enter a different path to the index the Not Found error is generated
Alfin update was solved with what Xerif indicated with the a2enmod rewrite
Related Resources http://blog.furiosojack.com/2017/04/integrate-apache-and-laravel-solution-http.html
For Laravel to work properly you must enable the url rewrite module in Apache (mod_rewrite).
To do so you can use the following command:
Then you have to restart apache.