What to fix if routes are returning 404 in a Laravel project

Although all the file / folder permissions appear to be set appropriately and if you are having issues with the routes, try the following.

  1. Enable mod_rewrite on the apache server using the following command
    sudo a2enmod rewrite
  2. Edit /etc/apache2/apache2.conf, changing the “AllowOverride” directive for the /var/www directory (which is my main document root):
    AllowOverride All
  3. Restart the apache server
    service apache2 restart
    (use sudo if required)

 

Leave a Reply

Your email address will not be published. Required fields are marked *