title: How to redirect a URL with a querystring
body: <p>I've moved a website to a new domain and I've used <code>RewriteRule</code> to redirect a number of my URLs.</p>
  
  <p><strong>I'm stuck</strong> trying to redirect URLs with query strings in them?</p>
  
  <pre><code>RewriteRule  /news/archive.php?cat=economic-impact http://www.new-website.com/faqs/economic-impact [R=301,L]
  RewriteRule /news/archive.php?cat=housing-need http://www.new-website.com/faqs/housing-need R=301,L]
  RewriteRule /news/archive.php?cat=infrastructure http://www.new-website.com/faqs/infrastructure R=301,L]
  </code></pre>
  
  <p>Further up the <code>htaccess</code> file I'm using this to redirect the domain</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{HTTP_HOST} ^old-website.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www.old-website.com$
  RewriteRule (.*)$ http://www.new-website.com/$1 [R=301]
  </code></pre>
  
  <p>When I visit: </p>
  
  <pre><code>old-website.com/news/archive.php?cat=economic-impact
  </code></pre>
  
  <p>it redirects to </p>
  
  <pre><code>new-website.com/news/archive.php?cat=economic-impact
  </code></pre>
  
  <p>Which 404s, I need to to redirect to:</p>
  
  <pre><code>new-website.com/faqs/economic-impact
  </code></pre>
  
  <p>Can anyone help?</p>