title: Friendly php URL for multiple languages using htaccess file (detect language from URL)
body: <p>I have a multi language php script which use URLs to detecting which language files should be load from template folder for user.</p>
  
  <p>for example:</p>
  
  <p>English version: <code>site.com/etc.php</code> or <code>site.com/etc.php?lang=EN</code> </p>
  
  <p>Arabic version: <code>site.com/etc.php?lang=AR</code></p>
  
  <p>but I want to have more pretty and also SEO friendlier URLs. So I need to detect language by a nicer way from URLs.</p>
  
  <p>for example:</p>
  
  <p>English version: <code>site.com/EN/etc.php</code></p>
  
  <p>Arabic version: <code>site.com/AR/etc.php</code></p>
  
  <p>is this possible by .htaccess file? (I search for solutions in stackoverflow, but it didn't work...)</p>
  
  <p>Thank you
  Amir</p>