title: htaccess 301 redirect query to new domain
body: <p>trying to redirect this query to a new domain:</p>
  
  <pre><code>www.domain.com/search.php?q=keyword
  </code></pre>
  
  <p>to</p>
  
  <pre><code>www.newdomain.com/search.php?q=keyword
  </code></pre>
  
  <p>keyword can be any word</p>
  
  <p>And want to keep the rest in domain, I just need to redirect this query.
  I try several ways and the one I found closer to solution is this one:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{QUERY_STRING} ^q=1$
  RewriteRule ^search\.php$ http://www.newdomain.com/search.php?q=$1 [R=301,L]
  </code></pre>
  
  <p>but does not work!
  Hope someone could help me correcting this and also if this is the best way to do the job?
  Many thanks.</p>