14

So I've just upgraded to Laravel 4, and I'm setting things up on a new server. The default / route works fine, but every other route returns a 404 error. When trying index.php/route, I get the requested data, so that means that .htaccess isn't working.

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

I have tried the following 3 .htaccess combinations:

<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 a server restart, and so on, none of them are working, and I'm still returning a 404 error.

Note: I am using several domains with the same laravel install, so my public folders are public/site1, public/site2, public/site3. However, I am routing the public paths to these folders, so I'm not sure that would be the problem.

Any thoughts?

Dalton Gore
  • 919
  • 2
  • 9
  • 21
  • What is your server ? xAMP, Apache ? Have you load the rewrite module ? Check for this line in your httpd.conf : `LoadModule rewrite_module modules/mod_rewrite.so` – Alexandre Butynski Jun 04 '13 at 08:37
  • @AlexandreButynski Apache. Yes, I loaded the rewrite module. I stated that above. And AllowOverride is All. I have no idea what's causing it. – Dalton Gore Jun 04 '13 at 08:41

1 Answers1

21

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

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

to each of the site's vhost files, and it worked beautifully. Derp derp.

Dalton Gore
  • 919
  • 2
  • 9
  • 21