title: change the parameter of link to be looking like folder
body: <p>How can I change the link of my website to be something like this: </p>
  
  <pre><code>example.com/en 
  example.com/fr
  example.com/et
  </code></pre>
  
  <p>I have a <code>lang?=something</code> parameter and I need to convert my link from <code>example.com/index.php?lang=en&amp;so=so</code> to   <code>example.com/en/index.php&amp;so=so</code></p>
  
  <p>my htaccess file :</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /   
  
  # empty url -&gt; redirect to en/
  RewriteCond %{QUERY_STRING} !lang=(en|ar)
  RewriteRule ^$ en/ [R=301,L]
  
  # url is ONLY '/en' or '/de' -&gt; redirect to /en/ or /de/ (adding slash)
  RewriteRule ^(en|ar)$  $1/ [R=301,L]
  
  # now all urls have en/ de/ -&gt; parse them
  RewriteRule ^(en|ar)/(.*)$  $2?lang=$1&amp;%{query_STRING} [L]
  # no "R=301" here --------------------------------------^
  </code></pre>
  
  <p>This is my code it is working very well but the problem is I would like to redirect the page to the correct link automatically not manually. </p>