title: mod_rewrite issue on Vagrant
body: <p>I've just made the move to Vagrant, have set-up a LAMP stack and am really pleased so far. The only issue I am experiencing is with mod_rewrite. I have confirmed mod_rewrite is turned on and it's working for redirects. </p>
  
  <p>The following code is in my vhost file:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName devserver.local
      DocumentRoot /var/www/public_html
  
      &lt;Directory /&gt;
          Options FollowSymLinks
          AllowOverride None
      &lt;/Directory&gt;
  
      &lt;Directory /var/www/public_html&gt;
          Options Indexes FollowSymLinks MultiViews
          AllowOverride All
          Order allow,deny
          allow from all
      &lt;/Directory&gt;
  
      ErrorLog /var/log/apache2/vagrant_dev-error.log
      LogLevel warn
      CustomLog /var/log/apache2/vagrant_dev-access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I then have the following in my .htaccess file:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  
  RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^tools\/([a-zA-Z_]+)\.json$ tools.php?tool=$1 [QSA,L]
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Basically how it "used to work" is I run <a href="http://www.devserver.local/tools/test_function.json" rel="nofollow">http://www.devserver.local/tools/test_function.json</a> and it rewrites to <a href="http://www.devserver.local/tools.php?tool=test_function" rel="nofollow">http://www.devserver.local/tools.php?tool=test_function</a></p>
  
  <p>Now that I am on vagrant it loads tools.php but without the query string <code>tool</code> (e.g: <a href="http://www.devserver.local/tools.php" rel="nofollow">http://www.devserver.local/tools.php</a>). It's almost like there is some configuration that allows PHP files to run without the .php.</p>
  
  <p>I can get it to work if I rename tools.php to tools-test.php and update my .htaccess to:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  
  RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^tools\/([a-zA-Z_]+)\.json$ tools-test.php?tool=$1 [QSA,L]
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>So it detects tools.php exits and loads that file before running my .htaccess file.</p>
  
  <p>I don't think it is specifically a Vagrant issue, it might just be a setting in Apache or mod_rewrite I need to turn on/off or configure. Has anyone experienced this before?</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>As Jon Lin mentioned below, it was an issue with <code>MultiViews</code> being turned on. I opted for disabling it in my vhosts file instead of Jon's suggestion of disabling it directly from .htaccess. Both worked.</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName devserver.local
      DocumentRoot /var/www/public_html
  
      &lt;Directory /&gt;
          Options FollowSymLinks
          AllowOverride None
      &lt;/Directory&gt;
  
      &lt;Directory /var/www/public_html&gt;
          Options Indexes FollowSymLinks
          AllowOverride All
          Order allow,deny
          allow from all
      &lt;/Directory&gt;
  
      ErrorLog /var/log/apache2/vagrant_dev-error.log
      LogLevel warn
      CustomLog /var/log/apache2/vagrant_dev-access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>