title: Rewrite Friendly php URL for multiple languages using .htaccess file
body: <p>I have a couple websites that I built a CMS for that will save the languages in an XML file and depending on the page and language selector, it will show the correct data. I cuurently have 8 different languages for each of the sites and the urls are like:</p>
  
  <p><a href="http://leclosdamboise.com/index.php?lang=fr" rel="nofollow">http://leclosdamboise.com/index.php?lang=fr</a></p>
  
  <p><a href="http://leclosdamboise.com/rooms.php?lang=en" rel="nofollow">http://leclosdamboise.com/rooms.php?lang=en</a></p>
  
  <p><a href="http://leclosdamboise.com/hotel.php?lang=de" rel="nofollow">http://leclosdamboise.com/hotel.php?lang=de</a></p>
  
  <p>I am trying to have it so that the urls are rewritten to look like this:</p>
  
  <p><a href="http://leclosdamboise.com/fr/index.php" rel="nofollow">http://leclosdamboise.com/fr/index.php</a></p>
  
  <p><a href="http://leclosdamboise.com/en/rooms.php" rel="nofollow">http://leclosdamboise.com/en/rooms.php</a></p>
  
  <p><a href="http://leclosdamboise.com/de/hotel.php" rel="nofollow">http://leclosdamboise.com/de/hotel.php</a></p>
  
  <p>I have spent hours combing through forums and not been able to find a solution that works. My .htaccess file currently looks like this:</p>
  
  <pre><code>SetEnv PHP_VER 5_TEST
  SetEnv REGISTER_GLOBALS 0
  
  RewriteEngine on
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([A-Za-z0-9]+)$ index.php?lang=$1 [QSA,L]
  </code></pre>
  
  <p>This does not do anything and the urls are still the ugly step-daughter version. The links above are actual links to one of the sites. Once I sort this out I need to deply it to several sites, but been racking my head trying to sort this out. Can anyone tell me what I'm doing wrong?</p>