title: Mod_rewrite cross domain extensions
body: <p><br>
  <br>
  I have multiple domain extensions and have therefore written a mod_rewrite that takes rewrites the URL back to a .com setting the original extension as a query parameter:</p>
  
  <pre><code>    RewriteCond %{HTTP_HOST} ^api\.example\.(co\.)?(.*)$
      RewriteCond %{HTTP_HOST} !^api\.example\.com$
      RewriteRule ^(.*)$ http://api.example.com/$1?l=%2 [QSA,R]
  </code></pre>
  
  <p>This works fine, my problem is that I need the internal redirect to be always to <code>api.example.com/index.php</code> so that for instance:<br><br>
  <code>api.example.fr/v1/users =&gt;</code> 
   <br><code>(ext) api.example.com/v1/users/?l=fr</code>
  <br> <code>(int) api.example.com/index.php</code><br>
  I've been messing about with this for some time now and would appreciate any help on the matter...<br><br> Many Regards</p>