laravel the requested url was not found on this server
This looks like you have to enable .htaccess
by adding this to your vhost:
<Directory /var/www/html/public/> Options Indexes FollowSymLinks AllowOverride All Require all granted</Directory>
If that doesn't work, make sure you have mod_rewrite enabled.
Don't forget to restart apache after making the changes! (service apache2 restart
)
I resolved by doing the following:Check if there is a module called rewrite.load in your apache at:
cd /etc/apache2/mods-enabled/
If it does not exist execute the following excerpt:
sudo a2enmod rewrite
Otherwise, change the Apache configuration file to consolidate use of the "friendly URL".
sudo nano /etc/apache2/apache2.conf
Find the following code inside the editor:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted</Directory>
Change to:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted</Directory>
After that restart the Apache server via:
sudo /etc/init.d/apache2 restart
First enable a2enmod rewrite
next restart the apache
/etc/init.d/apache2 restart