5

I am trying to make a simple server for local PHP development with Vagrant on mac OS 10.9.4.

Vagrant is running inside the main "~/Sites" directory with "/var/www/html" on the guest pointing there. The Vagrantfile looks like this:

config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.synced_folder ".", "/var/www/html"

On Apache, "000-default.conf" contains the default stuff, plus:

<Directory "/var/www/html">
    Options -Indexes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
</Directory>

mod_rewrite was activated with sudo a2enmod rewrite

The 'Sites' folder contains several websites based on Wordpress, Kirby, or Drupal. Each website's folder contains only the 'public' files and its own .htaccess (-> then to be uploaded to the 'public_html' directory of their own production servers).

Apache, Php and MySql are working well and the first page of each project is visible at localhost:8080/project, but it's impossible to navigate through the pages because url rewriting is not working (pages not found like there was no htaccess files).

What should I do to make the url rewriting work?

Chris Snow
  • 23,813
  • 35
  • 144
  • 309
François Romain
  • 13,617
  • 17
  • 89
  • 123
  • What does `/var/log/apache2/error.log` say on the Guest? – Brian Brownton Mar 19 '16 at 18:53
  • Have you tried to verify that mod_rewrite is really loaded? => http://stackoverflow.com/questions/9021425/how-to-check-if-mod-rewrite-is-enabled-in-php – Seybsen Dec 30 '16 at 20:41
  • Did you restart apache after `sudo a2enmod rewrite`? – Seybsen Dec 30 '16 at 20:41
  • Not sharing the "not working" .htaccess files leaves to answer the question a guessing game, so I only leave a link: [RewriteBase](https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase) – hakre Jan 23 '19 at 17:41

0 Answers0