Click Below to subscribe

Laravel routes not working on live server - returning 404 - 2021

If your project routes not working or returning 404 on the live server then you can fix the issue by doing two changes in your server configuration. 

  • Enable mod_rewrite on the apache server
sudo a2enmod rewrite
  • Edit /etc/apache2/apache2.conf, changing the "AllowOverride" directive for the /var/www directory (which is my main document root).
<Directory /var/www/>
 	Options Indexes FollowSymLinks
	AllowOverride all
	Require all granted

Finally, you need to restart the Apache server.

sudo service apache2 restart

Leave Your Comment