简体   繁体   English

apache和index.php laravel路由

[英]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 我设置了一个LAMP服务器,并且试图解决路由原因以启用路由,我需要添加IP / index.php / route

Here is my /etc/apache2/sites-available/html.conf 这是我的/etc/apache2/sites-available/html.conf

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

Here is my .htaccess 这是我的.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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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