title: Redirect all traffic to index.php using mod_rewrite
body: <p>I'm trying to build a url shortener, and I want to be able to take any characters immediately after the domain and have them passed as a variable url. So for example </p>
  
  <ul>
  <li><a href="http://google.com/asdf" rel="nofollow noreferrer">http://google.com/asdf</a> </li>
  </ul>
  
  <p>would become </p>
  
  <ul>
  <li><a href="http://www.google.com/?url=asdf" rel="nofollow noreferrer">http://www.google.com/?url=asdf</a>.</li>
  </ul>
  
  <p>Here's what I have for mod_rewrite right now, but I keep getting a 400 Bad Request:</p>
  
  <pre><code>RewriteEngine on  
  RewriteCond %{REQUEST_FILENAME} !-f  
  RewriteCond %{REQUEST_FILENAME} !-d  
  RewriteRule ^(.*) index.php?url=$1 [L,QSA]  
  </code></pre>