Report this

What is the reason for this report?

Laravel 4 NotFoundHttpException (LAMP)

Posted on June 29, 2014

Hi,

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).

/etc/apache2/sites-enabled/000-default.conf

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

/opt/carsX_d/public/.htaccess

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

    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]
</IfModule>

Any suggestions?

Thanks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.