title: Redirection with HTACCESS including GET parameters
body: <p>I have a specific .htaccess defined as is, in order to reroute all traffic from root folder to identical URL in a subfolder with exceptions on sub-domains.</p>
  
  <p>Here's my file:</p>
  
  <pre><code>#RewriteEngine on 
  #RewriteRule ^(.*)$ http://www.mydomain.fr/blog/$1 [R=301,QSA]
  &lt;IfModule mod_rewrite.c&gt;
  
  RewriteEngine On
  RewriteCond %{HTTP_HOST} !^joe\.mydomain\.fr$ [NC]
  RewriteCond %{HTTP_HOST} !^lab\.mydomain\.fr$ [NC]
  RewriteCond %{REQUEST_URI} !^joe(.*)
  RewriteCond %{REQUEST_URI} !^lab(.*)
  RedirectMatch ^/$ http://www.mydomain.fr/blog/
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>This file does exactly what I want: when I input something like <code>www.mydomain.fr/wp-admin</code> for example, it will redirect to <code>www.mydomain.fr/blog/wp-admin</code>, but will exclude subdomains <code>joe.mydomain.fr</code> and <code>lab.mydomain.fr</code> from redirection.</p>
  
  <p>However, what happens is that if I go to <code>joe.mydomain.fr?test=1</code>, the server will simply redirect  me to <code>joe.mydomain.fr</code> but the GET parameter disappears.</p>
  
  <p>How can I avoid that?</p>
  
  <p>I tried replacing <code>[NC]</code> with <code>[QSA]</code> or <code>[R=301,QSA]</code>, but I get an Internal Server Error.</p>
  
  <p>Thanks.</p>