title: .htaccess GET from query string (exception)
body: <p>I have a rewrite rule that works perfectly across domains but creates an endless loop on the same domain.</p>
  <pre><code>Allow from all
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ url.php?i=$1 [R=301,L]
  </code></pre>
  <p>the goal is to create an alternative to the 404 error that goes correctly to a page in a link shortening application.</p>
  <p>for example, example.com/abc needs to redirect to example.com/url.php?i=abc</p>
  <p>i.e. it fetches the 'abc' from after the '/'</p>
  <p>however as long as url.php is hosted on xyz.com it redirects once and ends up with</p>
  <p>example.com/url.php?i=url.php instead of the value &quot;abc&quot;</p>
  <p>What is the best way to fix this rewrite rule so it fetches 'abc' once and passes it to the correct url.php?</p>
  <p>thank you</p>