I always see that if mod_rewrite line - is it possible you don't have apache configured with mod_rewrite? therefor none of the rewrite conditions would work?
mod_rewrite is indeed enabled, but it does seem that the rewrite conditions are simply not being considered.
I solved this after some digging around and this is out there in different forms of solutions, but here is mine for other noobs out there that might struggle with figuring it out:
On Apache 2.4.7 then the default config is to use the /var/www/ to put your website html ie. your laravel install. The apache2.conf is also set to not allow .htaccess override by setting AllowOverride None like this
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Well you can change this by changing the apache2.conf, but this is not recommended due to the chance of it being overwritten by apache2 upgrades, etc. Instead of changing this then it is recommended to do this override in the VirtualHosts file for your site ie. sites-available/yoursite.com.conf
In this file then you need the above directive with the value for the directory right into your public folder on Laravel ie. /var/www/html/yoursite.com/laravelappinstall/public It should look something like this:
<Directory /var/www/html/yoursite.com/laravelappinstall/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Put that in yoursite.com.conf (Virtual Hosts config), make sure your .htaccess from in that folder looks just like the one from the Laravel install documentation Pretty URLs
Make sure that you have enabled the rewrite module ie. sudo a2enmod rewrite
Restart your web server ie. sudo service apache2 restart
And voila! You should be back in business with pretty url's. It is at least what finally worked for me and puts all of the info that I needed to find in different threads and piece together to finally make sense of what was going on. Hope it might help another noob!
Long live Laravel!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community