title: redirect language .htaccess only for root
body: <p>I am trying to redirect the visitor on the language from his navigator but only from the root.
  I have used this code:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  # Force the "www." at the beginning of URLs #-----------------
      RewriteCond %{HTTPS} !=on
      RewriteCond %{HTTP_HOST} !^$
      RewriteCond %{HTTP_HOST} !^www\. [NC]
      RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  
  # Language redirection  #----------
  # French
      RewriteCond %{REQUEST_URI} ^/$
      RewriteCond %{HTTP:Accept-Language} ^fr [NC]
      RewriteRule (.*) /?lang=fr [QSA,L]
  # English
      RewriteCond %{REQUEST_URI} ^/$
      RewriteCond %{HTTP:Accept-Language} ^en [NC]
      RewriteRule (.*) /?lang=en [QSA,L]
  </code></pre>
  
  <p>     </p>
  
  <p>it works but not perfectly; i got 2 problem;
  first one, the url is not really rewrite; the param ?lang=en is not write in the url; even if the page is the good one in english.</p>
  
  <p>The second problem, is that if i had a R=302 or 301
  like this:</p>
  
  <pre><code>    RewriteRule (.*) /?lang=en [QSA,R,L]
  </code></pre>
  
  <p>i got a loop and my website bug on this url www.mywebsite.com/?lang=en?lang=en?lang=en?lang=en?lang=en?lang=en?lang=en?lang=en etc...</p>
  
  <p>whats wrong in my code ?</p>
  
  <p>Sincerely.
  Paul.</p>