Laravel 4.htaccess Do Not Rewrite URLs

So, I just upgraded to Laravel 4, and I'm setting it up on a new server. The default route / works fine, but every other route returns a 404 error. When I try index.php/route I get the requested data, so this means .htaccess is not working.

Yes, AllowOverride is set to ALL .
Yes, I enabled the mod_rewrite module .

I tried the following 3 combinations .htaccess:

 <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> 

and

 <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> 

and

 Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] 

And after rebooting the server, etc. none of them work, and I'm still returning 404 error.

Note. I use several domains with the same laravel setting, so my public folders are public/site1 , public/site2 , public/site3 . However, I am directing public paths to these folders, so I'm not sure if this will be a problem.

Any thoughts?

+13
.htaccess laravel laravel-4
Jun 04 '13 at 7:29
source share
1 answer

I forgot to change vhosts in httpd.conf. Derp, derp. Added:

 <Directory "/var/www/public/site1"> AllowOverride All </Directory> 

for each of the vhost site files, and it worked beautifully. Derp derp.

+20
Jun 04 '13 at 13:43
source share



All Articles