简体   繁体   中英

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!

我将AllowOverride None更改为AllowOverride All

 /etc/apache2/apache2.conf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM