Laravel redirects to a route but then apache gives 404 error
The problem might come from a module in your Apache server called rewrite module.in windows you can just uncomment this line from your httpd.conf
#LoadModule rewrite_module modules/mod_rewrite.so
I'm running Ubuntu 14.04 and enabled it using
sudo a2enmod rewrite
Try these with an Apache restart.It might work for you as well.
After adding
AllowOverride All
to the vhost configuration, got it working. Probably the default configuration wasn't allowing the redirects?
Here's my final (and working) vhost configuration:
DocumentRoot /var/www/sitefolder/public ServerName site.domain.com <Directory /var/www/sitefolder/public> AllowOverride All allow from all Options +Indexes</Directory>
For VirtualHost
Only add these lines into httpd.conf
of your apache:
<Directory /var/www/sitefolder/public> AllowOverride All allow from all Options +Indexes</Directory>
Or you can replace the first line with:
<Directory />
And if all doesn't work, you can try:
<Directory /> Options FollowSymLinks AllowOverride All Require all granted</Directory>