Support the ongoing development of →
Configuration Requests Installation
Last updated 2 years ago.

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

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/

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/ It should look something like this:

<Directory /var/www/html/>
	Options Indexes FollowSymLinks
	AllowOverride All
	Require all granted

Put that in (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!


Thank you @iGitK72. This worked like a charm !


Sign in to participate in this thread!


Your banner here too?

iGitK72 igitk72 Joined 15 Sep 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.