Laravel all routes except '/' return 404

梦想的初衷 提交于 2019-12-05 19:44:56

After setting AllowOverride to all in apache2.conf and enabling mod_rewrite with the command a2enmod rewrite it all works.

I understand this is an old question but want to post my solution here. It might help others.

It is mainly the issue with apache virtual host. After the DocumentRoot, make sure you have the following script available in the vhost config file.

<Directory "/var/www/path/to/my/app/public">
        Options FollowSymLinks
        AllowOverride All

        Order allow,deny
        Allow from all
</Directory>

Another reason could be to enable apache rewrite mod. You can do it by using the following commands.

sudo a2enmod rewrite
sudo service apache2 restart

put

index.php

and

.httaccess

in same directory.

it's work for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!