title: htaccess to redirect one domain to another only if no parameters are provided?
body: <p>I have a domain oldexample.com, and I want to redirect users who visit that domain to newexample.com only when no parameters are given. In the case where parameters are supplied with the domain, it should redirect elsewhere - so, oldexample.com/?id=5 should not redirect to newexample.com, rather I want to redirect it to some internal directory in newexample.com, say to newexample.com/dir/5.</p>
  
  <p>Here's a summary of how I want the redirects to work:</p>
  
  <pre><code>oldexample.com -&gt; newexample.com
  oldexample.com/?id=3 -&gt; newexample.com/dir/3
  oldexample.com/index.php?id=6 -&gt; newexample.com/dir/6
  </code></pre>
  
  <p>So how would I write the RewriteRules in htaccess to get this job done?</p>