Routing and rewriting

Change the web root from /html/ to /public/ (for laravel):

edit 000-default.config:

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


change all /html/ to /public/


If the app only works through url.com/index.php/route (with index.php) make sure to allow override:

sudo nano /etc/apache2/apache2.conf
  • look for <Directory /var/www/>
  • Change "AllowOverride None" to "AllowOverride All"
  • Do the same thing under <Directory /usr/share/>
  • Save and exit the file


Then allow override and restart the server:

sudo a2enmod rewrite
sudo service apache2 restart

Comments (0)

Search Here