Search code examples
phpapachelampdigital-oceanadministration

apache and index.php laravel routing


After hours on forums I didn't find a solution so I hope you can help.

I setup a LAMP server and I'm trying to fix the routing cause to enable routing I need to add IP/index.php/route

Here is my /etc/apache2/sites-available/html.conf

 <VirtualHost *:80>
    DocumentRoot /var/www/html/public
 </VirtualHost>

Here is my .htaccess

<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>

I also ran

sudo a2ensite html.conf
sudo a2dissite 000.default.conf
sudo a2enmod rewrite

And I restarted the server- please help!


Solution

  • I changed AllowOverride None to AllowOverride All in

     /etc/apache2/apache2.conf