title: .htaccess RewriteRule country codes as a get param
body: <p>What I want to achieve:</p>
  
  <blockquote>
    <p><a href="http://example.com/en" rel="nofollow">http://example.com/en</a> -> <a href="http://example.com/?lang=en" rel="nofollow">http://example.com/?lang=en</a></p>
    
    <p><a href="http://example.com/en/something" rel="nofollow">http://example.com/en/something</a> -> <a href="http://example.com/something/?lang=en" rel="nofollow">http://example.com/something/?lang=en</a></p>
    
    <p><a href="http://example.com/ru" rel="nofollow">http://example.com/ru</a> -> <a href="http://example.com/?lang=ru" rel="nofollow">http://example.com/?lang=ru</a></p>
    
    <p><a href="http://example.com/ru/something" rel="nofollow">http://example.com/ru/something</a> -> <a href="http://example.com/something/?lang=ru" rel="nofollow">http://example.com/something/?lang=ru</a></p>
  </blockquote>
  
  <p>I try with:</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^en/(.+)$ /?p=$1&amp;lang=en [L,QSA]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ru/(.+)$ /?p=$1&amp;lang=ru [L,QSA]
  </code></pre>