1

I have installed Laravel 4 on my public_html folder locally, and I can access its public folder when declaring a vhost pointing to it, through the vhost url.

But, when I try to access Laravel public folder through its parent folders, I get an error in apache logs (error_log): $LARAVEL_HOME/public/.htaccess: Options not allowed here. Even if there is a AllowOverride All in $VHOST_CONF/site.

The first line in the .htaccess (Options Multiviews), is causing this error when I delete it, or put it in $VHOST_CONF/site, it works.

So, How do I do to I access through the hierarchy, without modifying the .htaccess file?

Hakim
  • 3,225
  • 5
  • 37
  • 75
  • you should never be accessing Laravel root folder "publically". The only folder you should every access "publically" is public – Laurence Aug 23 '13 at 11:10
  • I know but is it what was causing this error? – Hakim Aug 23 '13 at 11:21
  • 1
    The easiest thing (and probably the most secure) would be to install Laravel 4 below your `public_html`, delete your `public_html` folder and create a symlink `ln -s public public_html`. – tplaner Aug 23 '13 at 15:21
  • `FollowSymLink` must activated in Apache `Httpd`? – Hakim Aug 23 '13 at 15:38

1 Answers1

5

In the Apache configuration file for the website set AllowOverride to AllowOverride All similar to the following:

<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        # changed from None to All
        AllowOverride All
        Order allow,deny
        allow from all
</Directory>
Mark
  • 689
  • 10
  • 17
  • I think the best method to use (as suggested by @evolve) is to put only /public folder in `www` (public_html) folder. – Hakim Nov 30 '13 at 18:13
  • This fixed it for me, but only when I realised it was `sites-available/default` (`000-default.conf` in Ubuntu 13) that needed editing, and not the main `apache2.conf`. – MHG Mar 13 '14 at 08:00
  • Apache 2.4.41 complains about Order. – Tom Shaw Jan 30 '20 at 00:30