title: .htaccess redirect to language subfolder
body: <p><strong>What I have:</strong></p>
  
  <ul>
  <li>there are two languages installed: German and English</li>
  <li>language-versions are managed with subfolders (www.domain.com/de/ and www.domain.com/en/)</li>
  <li>machine: Typo3 4.5.4 / RealUrl installed</li>
  <li>mod_rewrite is enabled an works</li>
  </ul>
  
  <p><strong>What I want to do:</strong></p>
  
  <ul>
  <li>redirect requests without language subfolder to the German version </li>
  <li>e.g. domain.com/any/test/folder/ to domain.com/<strong>de</strong>/any/test/folder</li>
  </ul>
  
  <p><strong>What I tried:</strong></p>
  
  <pre><code>RedirectMatch permanent ^/(?!(?:(?:de|en)/))(.*)$ /de/$1
  </code></pre>
  
  <p><strong>Occuring problems:</strong></p>
  
  <ul>
  <li>all requests were directed to domain.com/de/index.php</li>
  <li>it caused an error 310 (net::ERR_TOO_MANY_REDIRECTS)</li>
  <li>maybe it fails with Typo3's htaccess entries?</li>
  </ul>
  
  <p><strong>my hole .htaccess-file:</strong></p>
  
  <pre><code># Enable URL rewriting
  RewriteEngine On
  
  # Change this path, if your TYPO3 installation is located in a subdirectory of the website root.
  # RewriteBase /
  
  # Rule for versioned static files, configured through:
  # - $TYPO3_CONF_VARS['BE']['versionNumberInFilename']
  # - $TYPO3_CONF_VARS['FE']['versionNumberInFilename']
  # IMPORTANT: This rule has to be the very first RewriteCond in order to work!
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
  
  # Stop rewrite processing, if we are in the typo3/ directory.
  RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
  
  # Redirect http://example.com/typo3 to http://example.com/typo3/index_re.php and stop the rewrite processing.
  RewriteRule ^typo3$ typo3/index_re.php [L]
  
  #301 redirection for language mode
  RedirectMatch permanent ^/(?!(?:(?:de|en)/))(.*)$ /de/$1
  
  # If the file/symlink/directory does not exist =&gt; Redirect to index.php.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  
  # Main URL rewriting.
  RewriteRule .* index.php [L]
  </code></pre>
  
  <p><strong>So, what can I do?</strong></p>