I am using Laravel, and have a problem with accessing parts of my app without appending index.php
to the URL. After some research on SO, I gathered that I needed to:
- Activate
rewrite_mod
, - Set
AllowOverride
toAll
Which I have done. Yet after doing all of this, a couple of new problems arise. First I can't get access to the public
folder, and I get the following error (when looking into apache2/error.log
):
[core:alert] [pid 15557] [client 87.81.146.231:56147] /var/www/data_exchange/laravel/public/.htaccess: RewriteBase takes one argument, the base URL of the per-directory context
Here's the .htaccess
file
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine ON
RewriteBase /laravel/ # Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Here's what the httpd.conf
(apache2.conf) looks like, I thought I'd add a new directory to see if it would fix the problem:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/data_exchange/laravel/public>
Options Indexes followSymlinks
allowoverride all
require all granted
</Directory>
Ideally, I want users to be able to navigate through the app without the need of adding the index.php.