title: How can I get mod_rewrite to rewrite everything?
body: <p>What I've been trying to achieve is to get my .htaccess file to rewrite ALL URLS.</p>
  
  <p>No matter what I do, however, I cannot get it ignore existing directories. And by that, I mean, act as if they don't exist.</p>
  
  <p>For example, say I have the following file structure:</p>
  
  <pre><code>/
      dir1
          file1.php
      dir2
          file2.php
      .htaccess
  </code></pre>
  
  <p>And suppose I want to redirect all traffic to <code>dir1/file1.php?url=path</code>.</p>
  
  <p>This never works for me if the path is an existing directory.</p>
  
  <p>For example, if I navigate to <code>url/path/stuff/dir2</code>, the "redirecting" works, but the URL in the address bar changes to <code>url/path/stuff/dir2/?url=dir2</code> for some unfathomable reason.</p>
  
  <p>Here is my <code>.htaccess</code>:</p>
  
  <pre><code>Options -MultiViews
  
  Options -Indexes
  
  Options +FollowSymLinks
  
  # so navigating to a url with a trailing slash won't cause problems
  DirectorySlash Off
  
  RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-f
  
  RewriteRule ^(.*)$ dir1/file1.php?url=$1 [QSA,L]
  </code></pre>