title: .htaccess Multiple Language Site
body: <p>Ok, so basically I have this part of the .htaccess partly working, but not quite fully just yet.  I have two subdirectories on my server for an english and a french site (the subdirectories are en, and fr, respectively).  When a user enters something in the URL bar I want whatever they typed in to be added to en or fr (depending on whatever the user's default language is on their computer).  </p>
  
  <p>If they type in domain.com/test (and their language is set to english), I want it to redirect to domain.com/en/test/.  I ONLY want this to happen if test is not a folder, directory, file, or ANYTHING that is in the root directory.</p>
  
  <p>Here is my .htaccess code so far that kind of works:</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
  RewriteCond %{HTTP:Accept-Language} ^en [NC]
  RewriteRule ^(.*)$ /en/$1/ [R=301,L]
  </code></pre>
  
  <p>The problem with my code though, however, is that if a user entered in something like domain.com/test/ (WITH the slash), it will not work because I have another part in my .htaccess that forces a slash on the end of everything.  If a user entered in domain.com/test.html (and that is a file in the root of the domain), it will not work because I have another part in my .htaccess that removes .html extensions.</p>
  
  <p>Basically, I need this redirect to work in absolutely all situations except where it logically shouldn't.</p>
  
  <p>Anyways, if any of you could please help me out I would really appreciate it.</p>