Laravel 4 NotFoundHttpException (LAMP)

June 29, 2014 1.3k views


I need some help. I've been trying to get to my Laravel app without success. I'm seeing the NotFoundHttpException (Whoops there was an error).


DocumentRoot /opt/carsX_d/public
<Directory "/opt/carsX_d/public">
Options Indexes Includes FollowSymLinks MultiViews
Require all granted
AllowOverride All
Order allow,deny
Allow from all


<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

Any suggestions?


2 Answers

Have you enabled mode_rewrite ? Your .htaccess file requires it. Run:

sudo a2enmod rewrite

Thanks, yes, I've run that command.

"Module rewrite already enabled"

I did move the entire Laravel folder structure under /var/www/html and now it seems to work. But I will need a solution to lock down all the folders except Public.

Have another answer? Share your knowledge.